explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FMrn

Settings
# exclusive inclusive rows x rows loops node
1. 1,795.525 11,391.677 ↑ 1.0 1,971 1

HashAggregate (cost=66,578.15..66,602.78 rows=1,971 width=36) (actual time=11,391.059..11,391.677 rows=1,971 loops=1)

  • Group Key: s.id
2. 5,061.036 9,596.152 ↓ 56.9 1,137,691 1

Hash Left Join (cost=619.90..66,378.17 rows=19,998 width=13) (actual time=12.780..9,596.152 rows=1,137,691 loops=1)

  • Hash Cond: (pe.position_id = p.id)
  • -> Nested Loop Left Join (cost=237.68..65720.97 rows=19998 width=24) (actual time=6.212..8936.683 rows=11376
  • -> Hash Right Join (cost=236.03..422.34 rows=9713 width=12) (actual time=6.181..358.239 rows=1130610 l
  • Hash Cond: (pes.segment_id = s.id)
  • -> Seq Scan on position_expenses_segments pes (cost=0.00..66.45 rows=4545 width=8) (actual time=
  • -> Bitmap Heap Scan on position_expenses_writeable_columns pe (cost=1.65..6.29 rows=43 width=28) (actu
  • Recheck Cond: ((pes.position_expense_id = id) OR (allocation_id = allocations_segments.allocation_
  • Heap Blocks: exact=1131635
3. 6.141 6.141 ↓ 1.4 5,895 1

Hash (cost=183.38..183.38 rows=4,212 width=8) (actual time=6.141..6.141 rows=5,895 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 288kB
  • -> Hash Right Join (cost=64.35..183.38 rows=4212 width=8) (actual time=1.153..4.436 rows=5
  • Hash Cond: (allocations_segments.segment_id = s.id)
  • -> Seq Scan on allocations_segments (cost=0.00..61.12 rows=4212 width=8) (actual tim
  • -> Hash (cost=39.71..39.71 rows=1971 width=4) (actual time=1.130..1.130 rows=1971 lo
  • Buckets: 2048 Batches: 1 Memory Usage: 86kB
  • -> Seq Scan on segments s (cost=0.00..39.71 rows=1971 width=4) (actual time=0.
4. 4,522.440 4,522.440 ↓ 0.0 0 1,130,610

BitmapOr (cost=1.65..1.65 rows=43 width=0) (actual time=0.004..0.004 rows=0 loops=1,130,610)

  • -> Bitmap Index Scan on personnel_expenses_pkey (cost=0.00..0.29 rows=1 width=0) (actual t
  • Index Cond: (pes.position_expense_id = id)
  • -> Bitmap Index Scan on personnel_expenses_allocation_id_idx (cost=0.00..0.60 rows=42 widt
  • Index Cond: (allocation_id = allocations_segments.allocation_id)
5. 6.535 6.535 ↓ 1.0 9,833 1

Hash (cost=259.32..259.32 rows=9,832 width=21) (actual time=6.535..6.535 rows=9,833 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 637kB
  • -> Seq Scan on positions_writeable_columns p (cost=0.00..259.32 rows=9832 width=21) (actual time=0.007
Planning time : 1.047 ms
Execution time : 11,391.903 ms