explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wgGA

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.717 1,559.727 ↑ 105.7 40 1

LockRows (cost=6,429.69..6,482.54 rows=4,228 width=200) (actual time=1,558.803..1,559.727 rows=40 loops=1)

  • Buffers: shared hit=2,072
2. 0.624 1,559.010 ↑ 105.7 40 1

Sort (cost=6,429.69..6,440.26 rows=4,228 width=200) (actual time=1,558.764..1,559.01 rows=40 loops=1)

  • Sort Key: outbox.queue, outbox."timestamp"
  • Sort Method: quicksort Memory: 36kB
  • Buffers: shared hit=2,027
3. 490.348 1,558.386 ↑ 105.7 40 1

Hash Join (cost=3,631.13..6,175.04 rows=4,228 width=200) (actual time=571.41..1,558.386 rows=40 loops=1)

  • Buffers: shared hit=2,027
4. 498.674 498.674 ↑ 1.0 66,762 1

Seq Scan on outbox outbox (cost=0..2,321.62 rows=66,762 width=160) (actual time=0.018..498.674 rows=66,762 loops=1)

  • Buffers: shared hit=1,654
5. 0.396 569.364 ↑ 105.7 40 1

Hash (cost=3,578.28..3,578.28 rows=4,228 width=56) (actual time=569.358..569.364 rows=40 loops=1)

  • Buffers: shared hit=373
6. 90.218 568.968 ↑ 105.7 40 1

Subquery Scan on ranked_partition (cost=3,134.38..3,578.28 rows=4,228 width=56) (actual time=183.791..568.968 rows=40 loops=1)

  • Filter: (ranked_partition.rnk <= 10)
  • Buffers: shared hit=373
7. 203.829 478.750 ↑ 1.1 12,000 1

WindowAgg (cost=3,134.38..3,419.75 rows=12,683 width=39) (actual time=183.773..478.75 rows=12,000 loops=1)

  • Buffers: shared hit=373
8. 186.004 274.921 ↑ 1.1 12,000 1

Sort (cost=3,134.38..3,166.09 rows=12,683 width=31) (actual time=183.736..274.921 rows=12,000 loops=1)

  • Sort Key: outbox_1.queue, outbox_1."timestamp", outbox_1.id
  • Sort Method: quicksort Memory: 1,322kB
  • Buffers: shared hit=373
9. 87.999 88.917 ↑ 1.1 12,000 1

Bitmap Heap Scan on outbox outbox_1 (cost=457.46..2,269.99 rows=12,683 width=31) (actual time=0.953..88.917 rows=12,000 loops=1)

  • Heap Blocks: exact=283
  • Buffers: shared hit=373
10. 0.918 0.918 ↑ 1.1 12,000 1

Bitmap Index Scan on ix_outbox_publish_ranked_partition (cost=0..454.29 rows=12,683 width=0) (actual time=0.913..0.918 rows=12,000 loops=1)

  • Index Cond: (outbox_1.publish_attempts < 5)
  • Buffers: shared hit=90
Planning time : 0.626 ms
Execution time : 1,560.287 ms