explain.depesz.com

PostgreSQL's explain analyze made readable

Result: grHd

Settings
# exclusive inclusive rows x rows loops node
1. 1.272 1,051.986 ↑ 1.0 1 1

Aggregate (cost=82,940.88..82,940.89 rows=1 width=8) (actual time=1,051.986..1,051.986 rows=1 loops=1)

2. 96.348 1,050.714 ↓ 1.2 18,344 1

HashAggregate (cost=82,605.41..82,754.51 rows=14,910 width=68) (actual time=1,044.991..1,050.714 rows=18,344 loops=1)

  • Group 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
3. 0.000 954.366 ↓ 11.9 176,822 1

Nested Loop Left Join (cost=53,681.02..82,307.21 rows=14,910 width=68) (actual time=407.737..954.366 rows=176,822 loops=1)

4. 25.601 664.434 ↓ 11.6 98,522 1

Nested Loop (cost=53,680.60..75,415.74 rows=8,469 width=68) (actual time=407.717..664.434 rows=98,522 loops=1)

  • Join Filter: (performance_purchaseorder.id = performance_booking_purchase_orders.purchaseorder_id)
5. 39.208 481.298 ↓ 3.0 31,507 1

Hash Join (cost=53,680.17..69,140.73 rows=10,475 width=84) (actual time=407.686..481.298 rows=31,507 loops=1)

  • Hash Cond: (t7.purchaseorder_id = performance_purchaseorder.id)
6. 105.280 225.384 ↓ 1.2 69,421 1

Hash Join (cost=15,399.44..30,534.99 rows=58,737 width=16) (actual time=189.418..225.384 rows=69,421 loops=1)

  • Hash Cond: (t7.booking_id = t8.id)
7. 59.759 59.759 ↑ 1.0 651,556 1

Seq Scan on performance_booking_purchase_orders t7 (cost=0.00..12,090.58 rows=655,358 width=32) (actual time=0.010..59.759 rows=651,556 loops=1)

8. 5.378 60.345 ↑ 1.0 29,182 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 1624kB
9. 54.967 54.967 ↑ 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.015..54.967 rows=29,182 loops=1)

  • Filter: ((created_at >= '2020-02-19'::date) AND (created_at <= '2020-03-19'::date))
  • Rows Removed by Filter: 299404
10. 51.832 216.706 ↓ 1.0 145,541 1

Hash (cost=36,473.89..36,473.89 rows=144,547 width=68) (actual time=216.706..216.706 rows=145,541 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 16394kB
11. 164.874 164.874 ↓ 1.0 145,541 1

Seq Scan on performance_purchaseorder (cost=0.00..36,473.89 rows=144,547 width=68) (actual time=0.207..164.874 rows=145,541 loops=1)

  • Filter: (delivery_at > '2020-03-20'::date)
  • Rows Removed by Filter: 665859
12. 157.535 157.535 ↑ 1.3 3 31,507

Index Scan using performance_booking_purchase_orders_purchaseorder_id_194c36ca on performance_booking_purchase_orders (cost=0.42..0.55 rows=4 width=16) (actual time=0.004..0.005 rows=3 loops=31,507)

  • Index Cond: (purchaseorder_id = t7.purchaseorder_id)
  • Filter: (booking_id IS NOT NULL)
13. 295.566 295.566 ↑ 2.0 2 98,522

Index Only Scan using performance_purchaseorder__purchaseorder_id_d3830b59 on performance_purchaseorder_shared_organizations (cost=0.43..0.77 rows=4 width=16) (actual time=0.002..0.003 rows=2 loops=98,522)

  • Index Cond: (purchaseorder_id = performance_purchaseorder.id)
  • Heap Fetches: 145169
Planning time : 1.335 ms
Execution time : 1,052.318 ms