explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FhDy

Settings
# exclusive inclusive rows x rows loops node
1. 112.565 1,455.648 ↑ 6.7 22 1

Unique (cost=165,475.42..170,056.59 rows=148 width=21) (actual time=1,248.389..1,455.648 rows=22 loops=1)

2. 434.307 1,343.083 ↓ 1.7 1,521,599 1

Sort (cost=165,475.42..167,766.00 rows=916,235 width=21) (actual time=1,248.389..1,343.083 rows=1,521,599 loops=1)

  • Sort Key: datasource_productline.name
  • Sort Method: quicksort Memory: 119941kB
3. 289.816 908.776 ↓ 1.7 1,521,599 1

Hash Join (cost=10,610.91..74,743.60 rows=916,235 width=21) (actual time=71.957..908.776 rows=1,521,599 loops=1)

  • Hash Cond: (inspections_bookingitem.product_category_id = datasource_productcategory.id)
4. 279.911 602.472 ↓ 1.7 1,521,599 1

Hash Join (cost=8,896.66..60,431.13 rows=916,235 width=4) (actual time=55.345..602.472 rows=1,521,599 loops=1)

  • Hash Cond: (inspections_bookingitem.booking_id = inspections_booking.id)
5. 267.421 267.421 ↓ 1.0 1,670,339 1

Seq Scan on inspections_bookingitem (cost=0.00..36,212.54 rows=1,642,554 width=8) (actual time=0.138..267.421 rows=1,670,339 loops=1)

  • Filter: (booking_id IS NOT NULL)
6. 12.280 55.140 ↓ 1.4 76,173 1

Hash (cost=8,219.38..8,219.38 rows=54,183 width=4) (actual time=55.140..55.140 rows=76,173 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 3702kB
7. 42.860 42.860 ↓ 1.4 76,173 1

Seq Scan on inspections_booking (cost=0.00..8,219.38 rows=54,183 width=4) (actual time=0.105..42.860 rows=76,173 loops=1)

  • Filter: (((status)::text = ANY ('{upcoming,new,waived,confirmed,rejected,merged}'::text[])) AND ((book_to_org_id = 252437) OR (executor_id = 252437) OR (book_from_org_id = 252437)))
  • Rows Removed by Filter: 20087
8. 5.842 16.488 ↓ 1.0 32,644 1

Hash (cost=1,306.83..1,306.83 rows=32,593 width=25) (actual time=16.488..16.488 rows=32,644 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 2056kB
9. 8.081 10.646 ↓ 1.0 32,644 1

Hash Join (cost=40.75..1,306.83 rows=32,593 width=25) (actual time=0.430..10.646 rows=32,644 loops=1)

  • Hash Cond: (datasource_productcategory.product_line_id = datasource_productline.id)
10. 2.237 2.237 ↓ 1.0 32,644 1

Seq Scan on datasource_productcategory (cost=0.00..817.93 rows=32,593 width=8) (actual time=0.095..2.237 rows=32,644 loops=1)

11. 0.180 0.328 ↓ 1.0 1,036 1

Hash (cost=28.11..28.11 rows=1,011 width=25) (actual time=0.328..0.328 rows=1,036 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 76kB
12. 0.148 0.148 ↓ 1.0 1,036 1

Seq Scan on datasource_productline (cost=0.00..28.11 rows=1,011 width=25) (actual time=0.004..0.148 rows=1,036 loops=1)