explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aqbR

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 727.411 ↑ 1.0 1 1

Aggregate (cost=67,224.00..67,224.01 rows=1 width=8) (actual time=727.410..727.411 rows=1 loops=1)

2. 0.027 727.402 ↓ 1.9 50 1

Unique (cost=67,223.06..67,223.66 rows=27 width=68) (actual time=727.374..727.402 rows=50 loops=1)

3. 0.157 727.375 ↓ 3.2 86 1

Sort (cost=67,223.06..67,223.12 rows=27 width=68) (actual time=727.373..727.375 rows=86 loops=1)

  • Sort Key: performance_purchaseorder.id, performance_purchaseorder.original_id, performance_purchaseorder.delivery_at, performance_purchaseorder.owner_id, performance_purchaseorder.factory_id, performance_purchaseorder.supplier_id, performance_purchaseorder.retailer_id, performance_purchaseorder.updated_at
  • Sort Method: quicksort Memory: 37kB
4. 0.044 727.218 ↓ 3.2 86 1

Nested Loop (cost=15,400.72..67,222.42 rows=27 width=68) (actual time=207.176..727.218 rows=86 loops=1)

  • Join Filter: (performance_purchaseorder.id = performance_booking_purchase_orders.purchaseorder_id)
5. 12.426 726.368 ↓ 1.8 62 1

Nested Loop Left Join (cost=15,400.30..67,203.43 rows=34 width=84) (actual time=207.127..726.368 rows=62 loops=1)

  • Filter: ((performance_purchaseorder.owner_id = 292218) OR (performance_purchaseorder_shared_organizations.organization_id = 292218))
  • Rows Removed by Filter: 49669
6. 38.073 556.407 ↓ 3.0 31,507 1

Nested Loop (cost=15,399.87..60,487.24 rows=10,473 width=84) (actual time=198.746..556.407 rows=31,507 loops=1)

7. 107.639 240.650 ↓ 1.2 69,421 1

Hash Join (cost=15,399.44..30,532.24 rows=58,726 width=16) (actual time=198.675..240.650 rows=69,421 loops=1)

  • Hash Cond: (t7.booking_id = t8.id)
8. 66.899 66.899 ↑ 1.0 651,479 1

Seq Scan on performance_booking_purchase_orders t7 (cost=0.00..12,088.39 rows=655,239 width=32) (actual time=0.014..66.899 rows=651,479 loops=1)

9. 5.398 66.112 ↑ 1.0 29,182 1

Hash (cost=15,031.49..15,031.49 rows=29,436 width=16) (actual time=66.112..66.112 rows=29,182 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1624kB
10. 60.714 60.714 ↑ 1.0 29,182 1

Seq Scan on performance_booking t8 (cost=0.00..15,031.49 rows=29,436 width=16) (actual time=0.013..60.714 rows=29,182 loops=1)

  • Filter: ((created_at >= '2020-02-19'::date) AND (created_at <= '2020-03-19'::date))
  • Rows Removed by Filter: 299371
11. 277.684 277.684 ↓ 0.0 0 69,421

Index Scan using performance_purchaseorder_pkey on performance_purchaseorder (cost=0.42..0.50 rows=1 width=68) (actual time=0.004..0.004 rows=0 loops=69,421)

  • Index Cond: (id = t7.purchaseorder_id)
  • Filter: (delivery_at > '2020-03-20'::date)
  • Rows Removed by Filter: 1
12. 157.535 157.535 ↑ 2.0 2 31,507

Index Only Scan using performance_purchaseorde_purchaseorder_id_organiz_8461f874_uniq on performance_purchaseorder_shared_organizations (cost=0.43..0.58 rows=4 width=20) (actual time=0.005..0.005 rows=2 loops=31,507)

  • Index Cond: (purchaseorder_id = performance_purchaseorder.id)
  • Heap Fetches: 42400
13. 0.806 0.806 ↑ 4.0 1 62

Index Scan using performance_booking_purchase_orders_purchaseorder_id_194c36ca on performance_booking_purchase_orders (cost=0.42..0.51 rows=4 width=16) (actual time=0.012..0.013 rows=1 loops=62)

  • Index Cond: (purchaseorder_id = t7.purchaseorder_id)
  • Filter: (booking_id IS NOT NULL)
Planning time : 2.995 ms
Execution time : 727.644 ms