explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P31g

Settings
# exclusive inclusive rows x rows loops node
1. 89.778 29,723.577 ↑ 451.2 8 1

Unique (cost=90,272.07..90,409.68 rows=3,610 width=3) (actual time=29,542.549..29,723.577 rows=8 loops=1)

2. 189.624 29,633.799 ↑ 1.9 14,265 1

Sort (cost=90,272.07..90,340.88 rows=27,522 width=3) (actual time=29,542.534..29,633.799 rows=14,265 loops=1)

  • Sort Key: inspections_purchaseorder.opo_number
  • Sort Method: quicksort Memory: 834kB
3. 266.777 29,444.175 ↑ 1.9 14,265 1

Hash Left Join (cost=83,476.06..88,242.56 rows=27,522 width=3) (actual time=26,739.269..29,444.175 rows=14,265 loops=1)

  • Hash Cond: (inspections_booking_purchase_orders.purchaseorder_id = inspections_purchaseorder.id)
4. 1,287.924 26,013.730 ↑ 1.9 14,265 1

Hash Right Join (cost=74,518.93..77,896.00 rows=27,522 width=4) (actual time=23,572.389..26,013.730 rows=14,265 loops=1)

  • Hash Cond: (inspections_booking_purchase_orders.booking_id = inspections_booking.id)
5. 1,153.833 1,153.833 ↑ 1.0 161,880 1

Seq Scan on inspections_booking_purchase_orders (cost=0.00..2,494.80 rows=161,880 width=8) (actual time=0.328..1,153.833 rows=161,880 loops=1)

6. 54.623 23,571.973 ↑ 1.9 7,613 1

Hash (cost=74,341.04..74,341.04 rows=14,231 width=4) (actual time=23,571.967..23,571.973 rows=7,613 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 396kB
7. 917.045 23,517.350 ↑ 1.9 7,613 1

Hash Left Join (cost=55,205.90..74,341.04 rows=14,231 width=4) (actual time=19,226.312..23,517.350 rows=7,613 loops=1)

  • Hash Cond: (inspections_booking.retailer_information_id = t9.id)
  • Filter: ((inspections_booking.book_to_org_id = 291715) OR (inspections_booking.executor_id = 291715) OR (inspections_booking.book_from_org_id = 291715) OR (inspections_customorgcontactlocation.org_id = 291715) OR (t7.org_id = 291715) OR (t9.org_id = 291715))
  • Rows Removed by Filter: 76090
8. 1,434.185 16,149.029 ↑ 1.0 83,703 1

Hash Left Join (cost=36,803.93..50,841.86 rows=83,703 width=28) (actual time=12,671.854..16,149.029 rows=83,703 loops=1)

  • Hash Cond: (inspections_booking.supplier_information_id = t7.id)
9. 1,402.819 8,435.473 ↑ 1.0 83,703 1

Hash Join (cost=18,401.97..28,517.69 rows=83,703 width=28) (actual time=6,387.254..8,435.473 rows=83,703 loops=1)

  • Hash Cond: (inspections_booking.factory_information_id = inspections_customorgcontactlocation.id)
10. 650.601 650.601 ↑ 1.0 83,703 1

Seq Scan on inspections_booking (cost=0.00..6,189.80 rows=83,703 width=28) (actual time=0.406..650.601 rows=83,703 loops=1)

  • Filter: ((status)::text = ANY ('{upcoming,new,waived,confirmed,rejected,merged}'::text[]))
11. 3,466.757 6,382.053 ↑ 1.0 416,843 1

Hash (cost=11,562.43..11,562.43 rows=416,843 width=8) (actual time=6,382.046..6,382.053 rows=416,843 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3059kB
12. 2,915.296 2,915.296 ↑ 1.0 416,843 1

Seq Scan on inspections_customorgcontactlocation (cost=0.00..11,562.43 rows=416,843 width=8) (actual time=0.375..2,915.296 rows=416,843 loops=1)

13. 3,409.597 6,279.371 ↑ 1.0 416,843 1

Hash (cost=11,562.43..11,562.43 rows=416,843 width=8) (actual time=6,279.365..6,279.371 rows=416,843 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3059kB
14. 2,869.774 2,869.774 ↑ 1.0 416,843 1

Seq Scan on inspections_customorgcontactlocation t7 (cost=0.00..11,562.43 rows=416,843 width=8) (actual time=0.246..2,869.774 rows=416,843 loops=1)

15. 3,528.984 6,451.276 ↑ 1.0 416,843 1

Hash (cost=11,562.43..11,562.43 rows=416,843 width=8) (actual time=6,451.270..6,451.276 rows=416,843 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3059kB
16. 2,922.292 2,922.292 ↑ 1.0 416,843 1

Seq Scan on inspections_customorgcontactlocation t9 (cost=0.00..11,562.43 rows=416,843 width=8) (actual time=0.333..2,922.292 rows=416,843 loops=1)

17. 1,742.248 3,163.668 ↑ 1.0 203,295 1

Hash (cost=5,620.95..5,620.95 rows=203,295 width=7) (actual time=3,163.662..3,163.668 rows=203,295 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 2925kB
18. 1,421.420 1,421.420 ↑ 1.0 203,295 1

Seq Scan on inspections_purchaseorder (cost=0.00..5,620.95 rows=203,295 width=7) (actual time=0.336..1,421.420 rows=203,295 loops=1)

Planning time : 24.468 ms