Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ailabs-software/c4973efe85b7ba4e3495926c40b27c64 to your computer and use it in GitHub Desktop.
Save ailabs-software/c4973efe85b7ba4e3495926c40b27c64 to your computer and use it in GitHub Desktop.
EXPLAIN (ANALYZE, BUFFERS)
SELECT COUNT(*) FROM (
SELECT publish_id, maturation_timestamp FROM publish_queue
WHERE status_executed=0
) ab
INNER JOIN publish ON(publish.funded AND publish.id=ab.publish_id);
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=142876.33..142876.34 rows=1 width=0) (actual time=1087.664..1087.664 rows=1 loops=1)
Buffers: shared hit=34882, temp read=4781 written=4775
-> Hash Join (cost=48806.97..141623.57 rows=501106 width=0) (actual time=697.450..1087.580 rows=1040 loops=1)
Hash Cond: (publish_queue.publish_id = publish.id)
Buffers: shared hit=34882, temp read=4781 written=4775
-> Index Scan using publish_queue_status_executed_idx on publish_queue (cost=0.43..72559.98 rows=504114 width=16) (actual time=0.019..118.063 rows=506236 loops=1)
Index Cond: (status_executed = 0)
Buffers: shared hit=28429
-> Hash (cost=27764.57..27764.57 rows=1210477 width=16) (actual time=697.331..697.331 rows=1208972 loops=1)
Buckets: 65536 Batches: 4 Memory Usage: 14210kB
Buffers: shared hit=6453, temp written=3985
-> Index Only Scan using publish_id_funded_idx on publish (cost=0.43..27764.57 rows=1210477 width=16) (actual time=0.020..190.199 rows=1208972 loops=1)
Index Cond: (funded = true)
Filter: funded
Heap Fetches: 590
Buffers: shared hit=6453
Total runtime: 1089.041 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment