By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
| id | holder_name |
|---|---|
| 1 | John Doe |
| 2 | JohnTravolta |
| 3 | ClarkKent420 |
| 4 | 42069 |
| 5 | 69 420 |
| 6 | 7822568373569 |
INSERT 0 6
INSERT 0 300000
| id | holder_name |
|---|---|
| 2198 | Trxlf |
| 8681 | oUHvOB |
| 10499 | xdHYb |
| 15338 | 2g@^S |
| 15828 | P@Kne |
| 22506 | =T2o@8 |
| 22563 | [lhlK: |
| 22819 | >o`D1@ |
| 22963 | 2u[R@C |
| 25341 | ^MJaREa |
| 25357 | T6:19] |
| 34981 | VV<OF |
| 38503 | i<V@ |
| 42596 | YKC]gh |
| 49968 | ?<QP> |
SELECT 15
| QUERY PLAN |
|---|
| Seq Scan on list (cost=0.00..4186.58 rows=68495 width=36) (actual time=0.128..992.137 rows=16 loops=1) |
| Filter: regexp_like(holder_name, '^[0123456789]+$'::text) |
| Rows Removed by Filter: 299990 |
| Planning Time: 0.056 ms |
| Execution Time: 992.175 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Finalize Aggregate (cost=4229.77..4229.78 rows=1 width=8) (actual time=797.382..797.498 rows=1 loops=1) |
| -> Gather (cost=4229.65..4229.76 rows=1 width=8) (actual time=738.014..797.485 rows=2 loops=1) |
| Workers Planned: 1 |
| Workers Launched: 1 |
| -> Partial Aggregate (cost=3229.65..3229.66 rows=1 width=8) (actual time=652.136..652.137 rows=1 loops=2) |
| -> Parallel Seq Scan on list (cost=0.00..3128.93 rows=40291 width=0) (actual time=0.857..652.115 rows=8 loops=2) |
| Filter: regexp_like(holder_name, '^[0123456789]+$'::text) |
| Rows Removed by Filter: 149995 |
| Planning Time: 0.148 ms |
| Execution Time: 797.596 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Result (cost=0.06..0.07 rows=1 width=1) (actual time=0.034..0.034 rows=1 loops=1) |
| InitPlan 1 (returns $0) |
| -> Seq Scan on list (cost=0.00..4186.58 rows=68495 width=0) (actual time=0.032..0.032 rows=1 loops=1) |
| Filter: regexp_like(holder_name, '^[0123456789]+$'::text) |
| Rows Removed by Filter: 3 |
| Planning Time: 0.074 ms |
| Execution Time: 0.059 ms |
EXPLAIN