By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
INSERT 0 100000
CREATE INDEX
VACUUM
| QUERY PLAN |
|---|
| Limit (cost=94.50..94.52 rows=10 width=20) (actual time=0.140..0.143 rows=10 loops=1) |
| Buffers: shared hit=63 read=3 written=3 |
| -> Sort (cost=94.50..94.62 rows=50 width=20) (actual time=0.135..0.137 rows=10 loops=1) |
| Sort Key: refreshed_utc |
| Sort Method: top-N heapsort Memory: 25kB |
| Buffers: shared hit=63 read=3 written=3 |
| -> Index Scan using tbl_foo_idx on tbl (cost=0.42..93.42 rows=50 width=20) (actual time=0.061..0.118 rows=63 loops=1) |
| Index Cond: ((purged_utc IS NULL) AND (refreshed_utc < '2021-07-11 00:00:00'::timestamp without time zone)) |
| Buffers: shared hit=63 read=3 written=3 |
| Planning: |
| Buffers: shared hit=34 read=1 written=1 |
| Planning Time: 0.344 ms |
| Execution Time: 0.181 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Limit (cost=0.42..8.44 rows=1 width=20) (actual time=0.041..0.041 rows=0 loops=1) |
| Buffers: shared hit=1 read=2 written=2 |
| -> Index Scan using tbl_foo_idx on tbl (cost=0.42..8.44 rows=1 width=20) (actual time=0.040..0.040 rows=0 loops=1) |
| Index Cond: ((purged_utc = '2021-07-11 00:00:00'::timestamp without time zone) AND (refreshed_utc < '2021-07-11 00:00:00'::timestamp without time zone)) |
| Buffers: shared hit=1 read=2 written=2 |
| Planning Time: 0.070 ms |
| Execution Time: 0.056 ms |
EXPLAIN