By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 19beta4 (Debian 19~beta4-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit |
SELECT 1
SELECT 421
INSERT 0 421
INSERT 0 842
INSERT 0 1684
INSERT 0 3368
| count |
|---|
| 6736 |
SELECT 1
SELECT 10
ALTER TABLE
ALTER TABLE
CREATE INDEX
CREATE INDEX
| QUERY PLAN |
|---|
| Aggregate (actual time=0.059..0.060 rows=1.00 loops=1) |
| Output: count(*) |
| Buffers: shared hit=2 |
| -> Seq Scan on public.tobj1 t1 (actual time=0.056..0.056 rows=0.00 loops=1) |
| Output: t1.id, t1.relname, t1.relnamespace, t1.reltype, t1.reloftype, t1.relowner, t1.relam, t1.relfilenode, t1.reltablespace, t1.relpages, t1.reltuples, t1.relallvisible, t1.relallfrozen, t1.reltoastrelid, t1.relhasindex, t1.relisshared, t1.relpersistence, t1.relkind, t1.relnatts, t1.relchecks, t1.relhasrules, t1.relhastriggers, t1.relhassubclass, t1.relrowsecurity, t1.relforcerowsecurity, t1.relispopulated, t1.relreplident, t1.relispartition, t1.relrewrite, t1.relfrozenxid, t1.relminmxid, t1.relacl, t1.reloptions, t1.relpartbound |
| Filter: (NOT (ANY (t1.id = (hashed SubPlan any_1).col1))) |
| Rows Removed by Filter: 10 |
| Buffers: shared hit=2 |
| SubPlan any_1 |
| -> Seq Scan on public.tobj1 t2 (actual time=0.005..0.006 rows=10.00 loops=1) |
| Output: t2.id |
| Buffers: shared hit=1 |
| Planning: |
| Buffers: shared hit=4 read=7 |
| Planning Time: 4.679 ms |
| Execution Time: 0.233 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Aggregate (actual time=1.476..1.477 rows=1.00 loops=1) |
| Output: count(*) |
| Buffers: shared hit=180 |
| -> Seq Scan on public.tobj t1 (actual time=0.022..1.250 rows=6624.00 loops=1) |
| Output: t1.id, t1.relname, t1.relnamespace, t1.reltype, t1.reloftype, t1.relowner, t1.relam, t1.relfilenode, t1.reltablespace, t1.relpages, t1.reltuples, t1.relallvisible, t1.relallfrozen, t1.reltoastrelid, t1.relhasindex, t1.relisshared, t1.relpersistence, t1.relkind, t1.relnatts, t1.relchecks, t1.relhasrules, t1.relhastriggers, t1.relhassubclass, t1.relrowsecurity, t1.relforcerowsecurity, t1.relispopulated, t1.relreplident, t1.relispartition, t1.relrewrite, t1.relfrozenxid, t1.relminmxid, t1.relacl, t1.reloptions, t1.relpartbound |
| Filter: (NOT (ANY (t1.id = (hashed SubPlan any_1).col1))) |
| Rows Removed by Filter: 112 |
| Buffers: shared hit=180 |
| SubPlan any_1 |
| -> Seq Scan on public.tobj1 t2 (actual time=0.003..0.004 rows=10.00 loops=1) |
| Output: t2.id |
| Filter: (t2.id IS NOT NULL) |
| Buffers: shared hit=1 |
| Planning: |
| Buffers: shared hit=4 read=1 |
| Planning Time: 0.367 ms |
| Execution Time: 1.499 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Aggregate (actual time=1.400..1.401 rows=1.00 loops=1) |
| Output: count(*) |
| Buffers: shared hit=180 |
| -> Hash Anti Join (actual time=0.061..1.177 rows=6624.00 loops=1) |
| Hash Cond: (t1.id = t2.id) |
| Buffers: shared hit=180 |
| -> Seq Scan on public.tobj t1 (actual time=0.014..0.504 rows=6736.00 loops=1) |
| Output: t1.id, t1.relname, t1.relnamespace, t1.reltype, t1.reloftype, t1.relowner, t1.relam, t1.relfilenode, t1.reltablespace, t1.relpages, t1.reltuples, t1.relallvisible, t1.relallfrozen, t1.reltoastrelid, t1.relhasindex, t1.relisshared, t1.relpersistence, t1.relkind, t1.relnatts, t1.relchecks, t1.relhasrules, t1.relhastriggers, t1.relhassubclass, t1.relrowsecurity, t1.relforcerowsecurity, t1.relispopulated, t1.relreplident, t1.relispartition, t1.relrewrite, t1.relfrozenxid, t1.relminmxid, t1.relacl, t1.reloptions, t1.relpartbound |
| Buffers: shared hit=179 |
| -> Hash (actual time=0.015..0.015 rows=10.00 loops=1) |
| Output: t2.id |
| Buckets: 1024 Batches: 1 Memory Usage: 9kB |
| Buffers: shared hit=1 |
| -> Seq Scan on public.tobj1 t2 (actual time=0.008..0.010 rows=10.00 loops=1) |
| Output: t2.id |
| Filter: (t2.id IS NOT NULL) |
| Buffers: shared hit=1 |
| Planning: |
| Buffers: shared hit=56 read=6 |
| Planning Time: 14.477 ms |
| Execution Time: 1.500 ms |
EXPLAIN