explain.depesz.com

A tool for finding a real cause for slow queries.

Result: qhb

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 57.215 1592.389 ↓ 13378.0 26756 1

Sort (cost=22445.30..22445.30 rows=2 width=169) (actual time=1589.728..1592.389 rows=26756 loops=1)

  • Sort Key: public.web_order.time_in
  • Sort Method: quicksort Memory: 7878kB
2. 295.944 1535.174 ↓ 13378.0 26756 1

Group (cost=22439.41..22445.29 rows=2 width=169) (actual time=912.486..1535.174 rows=26756 loops=1)

3. 42.355 918.158 ↓ 13378.0 26756 1

Sort (cost=22439.41..22439.42 rows=2 width=169) (actual time=912.405..918.158 rows=26756 loops=1)

  • Sort Key: public.web_order.web_order_id, public.web_order.order_number, store.store_id
  • Sort Method: quicksort Memory: 7876kB
4. 46.956 875.803 ↓ 13378.0 26756 1

Merge Right Join (cost=17179.91..22439.40 rows=2 width=169) (actual time=364.695..875.803 rows=26756 loops=1)

  • Merge Cond: (((public.web_order.order_number)::text = (public.web_order.order_number)::text) AND (public.web_order.store_id = public.web_order.store_id))
5. 7.173 163.140 ↑ 2.0 11374 1

Unique (cost=6617.26..6800.00 rows=23044 width=23) (actual time=152.328..163.140 rows=11374 loops=1)

6. 82.862 155.967 ↑ 1.0 24335 1

Sort (cost=6617.26..6678.17 rows=24365 width=23) (actual time=152.325..155.967 rows=24335 loops=1)

  • Sort Key: public.web_order.order_number, public.web_order.store_id, public.article.web_order_id
  • Sort Method: quicksort Memory: 2670kB
7. 17.560 73.105 ↑ 1.0 24335 1

Hash Join (cost=3414.22..4841.96 rows=24365 width=23) (actual time=48.644..73.105 rows=24335 loops=1)

  • Hash Cond: (public.article.web_order_id = public.web_order.web_order_id)
8. 6.971 6.971 ↑ 1.0 24335 1

Index Scan using "XIF1article" on article (cost=0.00..879.53 rows=24365 width=4) (actual time=0.013..6.971 rows=24335 loops=1)

9. 16.830 48.574 ↑ 1.0 61921 1

Hash (cost=2640.21..2640.21 rows=61921 width=23) (actual time=48.574..48.574 rows=61921 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 3386kB
10. 31.744 31.744 ↑ 1.0 61921 1

Seq Scan on web_order (cost=0.00..2640.21 rows=61921 width=23) (actual time=0.008..31.744 rows=61921 loops=1)

11. 27.304 665.707 ↓ 13378.0 26756 1

Materialize (cost=10562.64..15293.72 rows=2 width=169) (actual time=212.361..665.707 rows=26756 loops=1)

12. 22.278 638.403 ↓ 13378.0 26756 1

Nested Loop (cost=10562.64..15293.72 rows=2 width=169) (actual time=212.356..638.403 rows=26756 loops=1)

13. 19.266 562.613 ↓ 13378.0 26756 1

Nested Loop (cost=10562.64..15293.15 rows=2 width=148) (actual time=212.345..562.613 rows=26756 loops=1)

14. 76.919 436.323 ↓ 13378.0 26756 1

Merge Left Join (cost=10562.64..15292.37 rows=2 width=152) (actual time=212.319..436.323 rows=26756 loops=1)

  • Merge Cond: (((public.web_order.order_number)::text = (update_row.order_number)::text) AND (public.web_order.store_id = update_row.store_id))
  • Filter: ((update_row.web_order_id = public.web_order.web_order_id) OR (max_order.web_order_id = public.web_order.web_order_id))
15. 62.992 258.945 ↓ 1.2 60287 1

Merge Left Join (cost=7155.36..11586.37 rows=51081 width=156) (actual time=117.457..258.945 rows=60287 loops=1)

  • Merge Cond: (((public.web_order.order_number)::text = (max_order.order_number)::text) AND (public.web_order.store_id = max_order.store_id))
16. 75.347 75.347 ↓ 1.2 60287 1

Index Scan using web_order_order_number_store_id_idx on web_order (cost=0.00..4000.22 rows=51081 width=152) (actual time=0.025..75.347 rows=60287 loops=1)

  • Filter: (status = ANY ('{0,1}'::integer[]))
17. 36.757 120.606 ↑ 1.1 21566 1

Sort (cost=7155.36..7212.97 rows=23044 width=15) (actual time=117.426..120.606 rows=21566 loops=1)

  • Sort Key: max_order.order_number, max_order.store_id
  • Sort Method: quicksort Memory: 918kB
18. 1.526 83.849 ↑ 2.0 11374 1

Subquery Scan on max_order (cost=5024.70..5485.58 rows=23044 width=15) (actual time=79.881..83.849 rows=11374 loops=1)

19. 12.261 82.323 ↑ 2.0 11374 1

HashAggregate (cost=5024.70..5255.14 rows=23044 width=15) (actual time=79.880..82.323 rows=11374 loops=1)

20. 18.152 70.062 ↑ 1.0 24335 1

Hash Join (cost=3414.22..4841.96 rows=24365 width=15) (actual time=44.698..70.062 rows=24335 loops=1)

  • Hash Cond: (public.article.web_order_id = public.web_order.web_order_id)
21. 7.252 7.252 ↑ 1.0 24335 1

Index Scan using "XIF1article" on article (cost=0.00..879.53 rows=24365 width=4) (actual time=0.011..7.252 rows=24335 loops=1)

22. 14.522 44.658 ↑ 1.0 61921 1

Hash (cost=2640.21..2640.21 rows=61921 width=15) (actual time=44.658..44.658 rows=61921 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2903kB
23. 30.136 30.136 ↑ 1.0 61921 1

Seq Scan on web_order (cost=0.00..2640.21 rows=61921 width=15) (actual time=0.007..30.136 rows=61921 loops=1)

24. 54.484 100.459 ↓ 6.1 34239 1

Sort (cost=3407.28..3421.41 rows=5650 width=15) (actual time=94.848..100.459 rows=34239 loops=1)

  • Sort Key: update_row.order_number, update_row.store_id
  • Sort Method: quicksort Memory: 1110kB
25. 2.034 45.975 ↓ 2.7 15482 1

Subquery Scan on update_row (cost=2942.17..3055.17 rows=5650 width=15) (actual time=39.577..45.975 rows=15482 loops=1)

26. 22.125 43.941 ↓ 2.7 15482 1

HashAggregate (cost=2942.17..2998.67 rows=5650 width=15) (actual time=39.577..43.941 rows=15482 loops=1)

27. 18.195 21.816 ↓ 2.3 34237 1

Bitmap Heap Scan on web_order (cost=397.90..2828.32 rows=15180 width=15) (actual time=3.804..21.816 rows=34237 loops=1)

  • Recheck Cond: ((contract_id IS NULL) AND (status = 1))
  • Filter: (file_constructed = 0)
28. 3.621 3.621 ↓ 1.3 34635 1

Bitmap Index Scan on web_order_contract_id_status_idx (cost=0.00..394.10 rows=27295 width=0) (actual time=3.621..3.621 rows=34635 loops=1)

  • Index Cond: ((contract_id IS NULL) AND (status = 1))
29. 107.024 107.024 ↑ 1.0 1 26756

Index Scan using client_pkey on client (cost=0.00..0.38 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=26756)

  • Index Cond: (client_id = public.web_order.client_id)
30. 53.512 53.512 ↑ 1.0 1 26756

Index Scan using store_store_id_region_id_idx on store (cost=0.00..0.27 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=26756)

  • Index Cond: (store_id = public.web_order.store_id)
31.          

SubPlan (forGroup)

32. 26.756 321.072 ↑ 1.0 1 26756

Aggregate (cost=2.88..2.90 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=26756)

33. 294.316 294.316 ↑ 1.0 1 26756

Index Scan using web_order_order_number_store_id_idx on web_order order_contract (cost=0.00..2.88 rows=1 width=4) (actual time=0.010..0.011 rows=1 loops=26756)

  • Index Cond: (((order_number)::text = (public.web_order.order_number)::text) AND (store_id = public.web_order.store_id))
  • Filter: ((status < 2) AND (contract_id <> 0))