explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wdi : fast one

Settings
# exclusive inclusive rows x rows loops node
1. 10.773 40.896 ↑ 10.7 185 1

HashAggregate (cost=1,835.02..1,859.66 rows=1,971 width=36) (actual time=40.822..40.896 rows=185 loops=1)

  • Group Key: s.id
2. 3.279 30.123 ↑ 1.4 7,585 1

Hash Join (cost=517.38..1,728.71 rows=10,631 width=13) (actual time=8.960..30.123 rows=7,585 loops=1)

  • Hash Cond: ("*SELECT* 1".segment_id = s.id)
3. 3.894 25.496 ↑ 1.4 7,585 1

Hash Join (cost=453.03..1,518.19 rows=10,631 width=13) (actual time=7.583..25.496 rows=7,585 loops=1)

  • Hash Cond: ("*SELECT* 1".expense_id = pe.id)
4. 14.979 14.979 ↑ 1.4 7,585 1

Append (cost=49.09..968.07 rows=10,631 width=8) (actual time=0.938..14.979 rows=7,585 loops=1)

  • -> Subquery Scan on "*SELECT* 1" (cost=49.09..223.48 rows=4545 width=8) (actual time=0.938..4.81
  • -> Hash Join (cost=49.09..178.03 rows=4545 width=8) (actual time=0.937..4.123 rows=4543 lo
  • Hash Cond: (pes.position_expense_id = pe_1.id)
  • -> Seq Scan on position_expenses_segments pes (cost=0.00..66.45 rows=4545 width=8) (
  • -> Hash (cost=30.15..30.15 rows=1515 width=4) (actual time=0.904..0.904 rows=1517 lo
  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
  • -> Seq Scan on position_expenses_writeable_columns pe_1 (cost=0.00..30.15 rows
  • -> Subquery Scan on "*SELECT* 2" (cost=121.33..289.66 rows=4571 width=8) (actual time=2.217..3.5
  • -> Hash Join (cost=121.33..243.95 rows=4571 width=8) (actual time=2.216..3.304 rows=1525 l
  • Hash Cond: (als.allocation_id = a.id)
  • -> Seq Scan on allocations_segments als (cost=0.00..61.12 rows=4212 width=8) (actual
  • -> Hash (cost=102.39..102.39 rows=1515 width=12) (actual time=1.800..1.800 rows=1517
  • Buckets: 2048 Batches: 1 Memory Usage: 82kB
  • -> Hash Join (cost=51.41..102.39 rows=1515 width=12) (actual time=0.610..1.405
  • Hash Cond: (pe_2.allocation_id = a.id)
  • -> Seq Scan on position_expenses_writeable_columns pe_2 (cost=0.00..30.1
  • -> Hash (cost=33.96..33.96 rows=1396 width=4) (actual time=0.593..0.593
  • Buckets: 2048 Batches: 1 Memory Usage: 66kB
  • -> Seq Scan on allocations_writeable_columns a (cost=0.00..33.96 r
  • -> Subquery Scan on "*SELECT* 3" (cost=83.02..454.92 rows=1515 width=8) (actual time=1.329..5.74
  • -> Hash Join (cost=83.02..439.77 rows=1515 width=8) (actual time=1.328..5.521 rows=1517 lo
  • Hash Cond: (p_1.job_type_id = jt.id)
  • -> Hash Join (cost=49.09..385.01 rows=1515 width=8) (actual time=0.847..4.472 rows=1
  • Hash Cond: (p_1.id = pe_3.position_id)
  • -> Seq Scan on positions_writeable_columns p_1 (cost=0.00..259.32 rows=9832 wi
  • -> Hash (cost=30.15..30.15 rows=1515 width=20) (actual time=0.815..0.815 rows=
  • Buckets: 2048 Batches: 1 Memory Usage: 94kB
  • -> Seq Scan on position_expenses_writeable_columns pe_3 (cost=0.00..30.1
  • -> Hash (cost=22.86..22.86 rows=886 width=8) (actual time=0.461..0.461 rows=886 loop
  • Buckets: 1024 Batches: 1 Memory Usage: 43kB
  • -> Seq Scan on job_types_writeable_columns jt (cost=0.00..22.86 rows=886 width
5. 6.623 6.623 ↓ 1.0 1,517 1

Hash (cost=385.01..385.01 rows=1,515 width=13) (actual time=6.623..6.623 rows=1,517 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 89kB
  • -> Hash Join (cost=49.09..385.01 rows=1515 width=13) (actual time=1.273..5.954 rows=1517 loops=1
  • Hash Cond: (p.id = pe.position_id)
  • -> Seq Scan on positions_writeable_columns p (cost=0.00..259.32 rows=9832 width=21) (actua
  • -> Hash (cost=30.15..30.15 rows=1515 width=24) (actual time=1.250..1.250 rows=1517 loops=1
  • Buckets: 2048 Batches: 1 Memory Usage: 105kB
  • -> Seq Scan on position_expenses_writeable_columns pe (cost=0.00..30.15 rows=1515 wi
6. 1.348 1.348 ↑ 1.0 1,971 1

Hash (cost=39.71..39.71 rows=1,971 width=4) (actual time=1.348..1.348 rows=1,971 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 86kB
  • -> Seq Scan on segments s (cost=0.00..39.71 rows=1971 width=4) (actual time=0.016..0.626 rows=1971 loo