By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
| QUERY PLAN |
|---|
| Insert on data_log (cost=0.00..0.01 rows=0 width=0) (actual time=0.166..0.167 rows=0 loops=1) |
| -> Result (cost=0.00..0.01 rows=1 width=12) (actual time=0.002..0.003 rows=1 loops=1) |
| Planning Time: 0.056 ms |
| Execution Time: 0.224 ms |
EXPLAIN
TRUNCATE TABLE
CREATE INDEX
| QUERY PLAN |
|---|
| Insert on data_log (cost=0.00..0.01 rows=0 width=0) (actual time=0.902..0.903 rows=0 loops=1) |
| -> Result (cost=0.00..0.01 rows=1 width=12) (actual time=0.002..0.003 rows=1 loops=1) |
| Planning Time: 0.037 ms |
| Execution Time: 0.925 ms |
EXPLAIN
TRUNCATE TABLE
DROP INDEX
CREATE INDEX
| QUERY PLAN |
|---|
| Insert on data_log (cost=0.00..0.01 rows=0 width=0) (actual time=0.224..0.224 rows=0 loops=1) |
| -> Result (cost=0.00..0.01 rows=1 width=12) (actual time=0.002..0.003 rows=1 loops=1) |
| Planning Time: 0.036 ms |
| Execution Time: 0.270 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=0.00..35.65 rows=10 width=12) (actual time=0.040..0.041 rows=1 loops=1) |
| Group Key: data_log.id |
| -> Seq Scan on data_log (cost=0.00..35.50 rows=10 width=12) (actual time=0.012..0.012 rows=1 loops=1) |
| Filter: (id = 1) |
| Planning Time: 0.497 ms |
| Execution Time: 0.142 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Nested Loop Anti Join (cost=0.00..72.16 rows=7 width=24) (actual time=0.031..0.032 rows=1 loops=1) |
| Join Filter: (l.creation_date < ll.creation_date) |
| Rows Removed by Join Filter: 1 |
| -> Seq Scan on data_log l (cost=0.00..35.50 rows=10 width=12) (actual time=0.008..0.009 rows=1 loops=1) |
| Filter: (id = 1) |
| -> Materialize (cost=0.00..35.55 rows=10 width=12) (actual time=0.019..0.020 rows=1 loops=1) |
| -> Seq Scan on data_log ll (cost=0.00..35.50 rows=10 width=12) (actual time=0.005..0.005 rows=1 loops=1) |
| Filter: (id = 1) |
| Planning Time: 0.395 ms |
| Execution Time: 0.079 ms |
EXPLAIN