explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GBBR

Settings
# exclusive inclusive rows x rows loops node
1. 125.956 2,143.609 ↑ 6.7 22 1

Unique (cost=197,883.89..203,072.05 rows=148 width=21) (actual time=1,911.777..2,143.609 rows=22 loops=1)

2. 440.733 2,017.653 ↓ 1.5 1,527,976 1

Sort (cost=197,883.89..200,477.97 rows=1,037,632 width=21) (actual time=1,911.776..2,017.653 rows=1,527,976 loops=1)

  • Sort Key: datasource_productline.name
  • Sort Method: quicksort Memory: 120274kB
3. 287.381 1,576.920 ↓ 1.5 1,527,976 1

Hash Join (cost=27,183.34..94,199.22 rows=1,037,632 width=21) (actual time=745.807..1,576.920 rows=1,527,976 loops=1)

  • Hash Cond: (inspections_bookingitem.product_category_id = datasource_productcategory.id)
4. 281.715 1,273.341 ↓ 1.5 1,527,976 1

Hash Join (cost=25,469.10..78,217.53 rows=1,037,632 width=4) (actual time=729.473..1,273.341 rows=1,527,976 loops=1)

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

Seq Scan on inspections_bookingitem (cost=0.00..36,212.54 rows=1,642,554 width=8) (actual time=0.114..262.537 rows=1,670,379 loops=1)

  • Filter: (booking_id IS NOT NULL)
6. 12.798 729.089 ↓ 1.2 76,490 1

Hash (cost=24,702.07..24,702.07 rows=61,362 width=4) (actual time=729.089..729.089 rows=76,490 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 3714kB
7. 74.771 716.291 ↓ 1.2 76,490 1

Seq Scan on inspections_booking (cost=16,239.86..24,702.07 rows=61,362 width=4) (actual time=0.091..716.291 rows=76,490 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) OR (hashed SubPlan 1)))
  • Rows Removed by Filter: 19774
8.          

SubPlan (forSeq Scan)

9. 641.520 641.520 ↑ 1.1 125,267 1

Seq Scan on inspections_customorgcontactlocation u0 (cost=0.00..15,907.10 rows=133,103 width=4) (actual time=0.088..641.520 rows=125,267 loops=1)

  • Filter: (org_id = 252437)
  • Rows Removed by Filter: 333448
10. 5.384 16.198 ↓ 1.0 32,644 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 2056kB
11. 8.245 10.814 ↓ 1.0 32,644 1

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

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

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

13. 0.193 0.320 ↓ 1.0 1,036 1

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

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 76kB
14. 0.127 0.127 ↓ 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.127 rows=1,036 loops=1)