explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MYdm

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 112.057 3,531.948 ↑ 6.7 22 1

Unique (cost=250,535.46..255,872.20 rows=148 width=21) (actual time=3,321.709..3,531.948 rows=22 loops=1)

2. 427.867 3,419.891 ↓ 1.4 1,528,848 1

Sort (cost=250,535.46..253,203.83 rows=1,067,348 width=21) (actual time=3,321.709..3,419.891 rows=1,528,848 loops=1)

  • Sort Key: datasource_productline.name
  • Sort Method: quicksort Memory: 120318kB
3. 283.205 2,992.024 ↓ 1.4 1,528,848 1

Hash Join (cost=75,942.46..143,664.04 rows=1,067,348 width=21) (actual time=2,170.322..2,992.024 rows=1,528,848 loops=1)

  • Hash Cond: (inspections_bookingitem.product_category_id = datasource_productcategory.id)
4. 278.439 2,691.616 ↓ 1.4 1,528,848 1

Hash Join (cost=74,228.22..127,273.76 rows=1,067,348 width=4) (actual time=2,153.021..2,691.616 rows=1,528,848 loops=1)

  • Hash Cond: (inspections_bookingitem.booking_id = inspections_booking.id)
5. 260.539 260.539 ↓ 1.0 1,671,594 1

Seq Scan on inspections_bookingitem (cost=0.00..36,212.54 rows=1,642,554 width=8) (actual time=0.113..260.539 rows=1,671,594 loops=1)

  • Filter: (booking_id IS NOT NULL)
6. 13.362 2,152.638 ↓ 1.2 76,541 1

Hash (cost=73,438.42..73,438.42 rows=63,184 width=4) (actual time=2,152.638..2,152.638 rows=76,541 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 3715kB
7. 47.754 2,139.276 ↓ 1.2 76,541 1

Hash Left Join (cost=62,176.53..73,438.42 rows=63,184 width=4) (actual time=1,958.673..2,139.276 rows=76,541 loops=1)

  • Hash Cond: (inspections_booking.retailer_information_id = t10.id)
  • Filter: ((inspections_booking.book_to_org_id = 252437) OR (inspections_booking.executor_id = 252437) OR (inspections_booking.book_from_org_id = 252437) OR (inspections_customorgcontactlocation.org_id = 252437) OR (t8.org_id = 252437) OR (t10.org_id = 252437))
  • Rows Removed by Filter: 19801
8. 46.160 1,448.644 ↓ 1.4 96,342 1

Hash Left Join (cost=41,451.02..50,830.31 rows=68,612 width=28) (actual time=1,313.892..1,448.644 rows=96,342 loops=1)

  • Hash Cond: (inspections_booking.supplier_information_id = t8.id)
9. 46.251 726.215 ↓ 1.4 96,342 1

Hash Join (cost=20,725.51..29,167.54 rows=68,612 width=28) (actual time=635.711..726.215 rows=96,342 loops=1)

  • Hash Cond: (inspections_booking.factory_information_id = inspections_customorgcontactlocation.id)
10. 46.367 46.367 ↓ 1.4 96,342 1

Seq Scan on inspections_booking (cost=0.00..7,498.61 rows=68,612 width=28) (actual time=0.084..46.367 rows=96,342 loops=1)

  • Filter: ((status)::text = ANY ('{upcoming,new,waived,confirmed,rejected,merged}'::text[]))
11. 66.028 633.597 ↑ 1.0 458,943 1

Hash (cost=14,718.56..14,718.56 rows=480,556 width=8) (actual time=633.597..633.597 rows=458,943 loops=1)

  • Buckets: 524288 Batches: 1 Memory Usage: 22024kB
12. 567.569 567.569 ↑ 1.0 458,943 1

Seq Scan on inspections_customorgcontactlocation (cost=0.00..14,718.56 rows=480,556 width=8) (actual time=0.085..567.569 rows=458,943 loops=1)

13. 64.484 676.269 ↑ 1.0 458,943 1

Hash (cost=14,718.56..14,718.56 rows=480,556 width=8) (actual time=676.269..676.269 rows=458,943 loops=1)

  • Buckets: 524288 Batches: 1 Memory Usage: 22024kB
14. 611.785 611.785 ↑ 1.0 458,943 1

Seq Scan on inspections_customorgcontactlocation t8 (cost=0.00..14,718.56 rows=480,556 width=8) (actual time=0.086..611.785 rows=458,943 loops=1)

15. 67.110 642.878 ↑ 1.0 458,943 1

Hash (cost=14,718.56..14,718.56 rows=480,556 width=8) (actual time=642.878..642.878 rows=458,943 loops=1)

  • Buckets: 524288 Batches: 1 Memory Usage: 22024kB
16. 575.768 575.768 ↑ 1.0 458,943 1

Seq Scan on inspections_customorgcontactlocation t10 (cost=0.00..14,718.56 rows=480,556 width=8) (actual time=0.084..575.768 rows=458,943 loops=1)

17. 6.091 17.203 ↓ 1.0 32,644 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 2056kB
18. 8.399 11.112 ↓ 1.0 32,644 1

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

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

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

20. 0.180 0.327 ↓ 1.0 1,036 1

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

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

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

Planning time : 1.693 ms