explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3zqu

Settings
# exclusive inclusive rows x rows loops node
1. 0.102 7,885,388.216 ↑ 1.0 1,000 1

Limit (cost=3,782,515,957.78..3,782,515,960.28 rows=1,000 width=150) (actual time=7,885,387.870..7,885,388.216 rows=1,000 loops=1)

  • Buffers: shared hit=1,309,569,291 read=4,111
2. 456.388 7,885,388.114 ↑ 189.2 1,000 1

Sort (cost=3,782,515,957.78..3,782,516,430.76 rows=189,189 width=150) (actual time=7,885,387.869..7,885,388.114 rows=1,000 loops=1)

  • Sort Key: order_.status_date
  • Sort Method: top-N heapsort Memory: 4,087kB
  • Buffers: shared hit=1,309,569,291 read=4,111
3. 7,780.710 7,884,931.726 ↑ 1.0 187,208 1

Seq Scan on order_ (cost=0.00..3,782,505,584.75 rows=189,189 width=150) (actual time=45.455..7,884,931.726 rows=187,208 loops=1)

  • Filter: ((status_date < '2018-08-21 00:00:00'::timestamp without time zone) AND (((status_date = '2013-08-21 00:00:00'::timestamp without time zone) AND (id > 13652)) OR (status_date > '2013-08-21 00:00:00'::timestamp without time zone)))
  • Rows Removed by Filter: 31,488
  • Buffers: shared hit=1,309,569,291 read=4,111
4.          

SubPlan (for Seq Scan)

5. 1,310.456 5,429.032 ↑ 1.0 1 187,208

Nested Loop (cost=0.84..4.89 rows=1 width=18) (actual time=0.028..0.029 rows=1 loops=187,208)

  • Buffers: shared hit=1,499,213 read=500
6. 1,872.080 1,872.080 ↑ 1.0 1 187,208

Index Scan using project_pkey on project (cost=0.42..2.44 rows=1 width=4) (actual time=0.009..0.010 rows=1 loops=187,208)

  • Index Cond: (order_.project_id = id)
  • Buffers: shared hit=749,857
7. 2,246.496 2,246.496 ↑ 1.0 1 187,208

Index Scan using customer_pkey on customer (cost=0.42..2.44 rows=1 width=22) (actual time=0.012..0.012 rows=1 loops=187,208)

  • Index Cond: (id = project.customer_id)
  • Buffers: shared hit=749,356 read=500
8. 1,123.248 1,497.664 ↑ 1.0 1 187,208

Nested Loop (cost=0.84..4.89 rows=1 width=18) (actual time=0.007..0.008 rows=1 loops=187,208)

  • Buffers: shared hit=1,499,713
9. 187.208 187.208 ↑ 1.0 1 187,208

Index Scan using project_pkey on project project_1 (cost=0.42..2.44 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=187,208)

  • Index Cond: (order_.project_id = id)
  • Buffers: shared hit=749,857
10. 187.208 187.208 ↑ 1.0 1 187,208

Index Scan using customer_pkey on customer customer_1 (cost=0.42..2.44 rows=1 width=22) (actual time=0.001..0.001 rows=1 loops=187,208)

  • Index Cond: (id = project_1.customer_id)
  • Buffers: shared hit=749,856
11. 7,301.112 7,636,588.736 ↑ 1.0 1 187,208

Aggregate (cost=18,265.98..18,265.99 rows=1 width=24) (actual time=40.792..40.792 rows=1 loops=187,208)

  • Buffers: shared hit=1,255,911,633
12. 7,629,287.624 7,629,287.624 ↑ 1.0 7 187,208

Index Scan using order_total_type_order_id_key on order_total ot (cost=0.43..18,265.94 rows=7 width=24) (actual time=2.568..40.753 rows=7 loops=187,208)

  • Index Cond: (order_.id = order_id)
  • Buffers: shared hit=1,255,911,633
13. 5,616.240 5,616.240 ↑ 1.0 1 187,208

Index Scan using address_pkey on address addr (cost=0.42..2.44 rows=1 width=277) (actual time=0.030..0.030 rows=1 loops=187,208)

  • Index Cond: (order_.shipping_address_id = id)
  • Buffers: shared hit=748,826 read=1,032
14. 4,118.576 6,739.488 ↑ 1.0 1 187,208

Aggregate (cost=2.85..2.86 rows=1 width=134) (actual time=0.036..0.036 rows=1 loops=187,208)

  • Buffers: shared hit=772,527 read=598
15. 2,620.912 2,620.912 ↑ 2.0 1 187,208

Index Scan using index_shipping_order_id on shipping sh (cost=0.42..2.83 rows=2 width=134) (actual time=0.014..0.014 rows=1 loops=187,208)

  • Index Cond: (order_.id = order_id)
  • Buffers: shared hit=772,527 read=598
16. 3,267.792 221,279.856 ↑ 1.0 1 187,208

Aggregate (cost=1,712.12..1,712.13 rows=1 width=100) (actual time=1.182..1.182 rows=1 loops=187,208)

  • Buffers: shared hit=49,131,510 read=1,981
17. 3,556.952 3,556.952 ↑ 1.5 2 187,208

Index Scan using index_order_detail_order_id on order_detail (cost=0.42..3.00 rows=3 width=100) (actual time=0.017..0.019 rows=2 loops=187,208)

  • Index Cond: (order_id = order_.id)
  • Buffers: shared hit=806,511 read=836
18.          

SubPlan (for Aggregate)

19. 602.402 206,322.685 ↑ 1.0 1 301,201

Aggregate (cost=561.73..561.74 rows=1 width=65) (actual time=0.685..0.685 rows=1 loops=301,201)

  • Buffers: shared hit=45,387,063 read=274
20. 377.156 205,720.283 ↓ 0.0 0 301,201

Nested Loop (cost=0.71..561.72 rows=1 width=65) (actual time=0.625..0.683 rows=0 loops=301,201)

  • Buffers: shared hit=45,387,063 read=274
21. 204,515.479 204,515.479 ↓ 0.0 0 301,201

Index Only Scan using order_detail_discount_pkey on order_detail_discount odd (cost=0.29..559.28 rows=1 width=4) (actual time=0.622..0.679 rows=0 loops=301,201)

  • Index Cond: (order_detail_id = order_detail.id)
  • Heap Fetches: 0
  • Buffers: shared hit=45,180,151
22. 827.648 827.648 ↑ 1.0 1 51,728

Index Scan using discount_pkey on discount d (cost=0.42..2.44 rows=1 width=65) (actual time=0.016..0.016 rows=1 loops=51,728)

  • Index Cond: (id = odd.discount_id)
  • Buffers: shared hit=206,912 read=274
23. 2,710.809 8,132.427 ↑ 1.0 1 301,201

Aggregate (cost=7.95..7.96 rows=1 width=51) (actual time=0.027..0.027 rows=1 loops=301,201)

  • Buffers: shared hit=2,937,936 read=871
24. 322.484 5,421.618 ↑ 1.0 1 301,201

Nested Loop (cost=0.84..7.94 rows=1 width=51) (actual time=0.015..0.018 rows=1 loops=301,201)

  • Buffers: shared hit=2,937,936 read=871
25. 1,204.804 1,204.804 ↑ 2.0 1 301,201

Index Scan using index_shipping_order_id on shipping sh_1 (cost=0.42..2.83 rows=2 width=4) (actual time=0.004..0.004 rows=1 loops=301,201)

  • Index Cond: (order_.id = order_id)
  • Buffers: shared hit=1,282,895
26. 3,894.330 3,894.330 ↑ 1.0 1 389,433

Index Scan using index_shipping__detail_parent_id on shipping_detail sd (cost=0.42..2.54 rows=1 width=51) (actual time=0.009..0.010 rows=1 loops=389,433)

  • Index Cond: (shipping_id = sh_1.id)
  • Filter: (order_detail.id = order_detail_id)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=1,655,041 read=871
Planning time : 1.214 ms
Execution time : 7,885,390.676 ms