explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MGgo : test

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=780.41..780.42 rows=1 width=292) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=780.41..780.42 rows=1 width=292) (actual rows= loops=)

  • Sort Key: tmp."Order ID", tmp.order_discr
3. 0.000 0.000 ↓ 0.0

Subquery Scan on tmp (cost=768.43..780.40 rows=1 width=292) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=768.43..780.39 rows=1 width=304) (actual rows= loops=)

  • Group Key: sv.id, sv.name
  • Filter: (CASE WHEN ((GROUPING(sv.id) = 0) AND (GROUPING(sv.name) = 0)) THEN 1 ELSE 0 END = 1)
5. 0.000 0.000 ↓ 0.0

Sort (cost=768.43..768.48 rows=20 width=92) (actual rows= loops=)

  • Sort Key: sv.id, sv.name
6. 0.000 0.000 ↓ 0.0

Subquery Scan on sv (cost=0.42..768.00 rows=20 width=92) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Append (cost=0.42..767.80 rows=20 width=1,223) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Result (cost=0.42..690.09 rows=14 width=1,223) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Append (cost=0.42..689.88 rows=14 width=1,215) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Result (cost=0.42..365.42 rows=10 width=1,215) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Append (cost=0.42..365.29 rows=10 width=1,211) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=0.42..75.52 rows=9 width=1,000) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..75.40 rows=9 width=996) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Append (cost=0.00..24.68 rows=6 width=646) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_orders o (cost=0.00..0.00 rows=1 width=644) (actual rows= loops=)

  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone) AND (shop_id = 80))
16. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_1 (cost=0.29..16.34 rows=4 width=644) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone))
17. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_2 (cost=0.29..8.31 rows=1 width=653) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone))
18. 0.000 0.000 ↓ 0.0

Index Scan using index_shopify_line_items_on_shopify_order_id on shopify_line_items l (cost=0.42..8.44 rows=1 width=276) (actual rows= loops=)

  • Index Cond: (shopify_order_id = o.id)
19. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=0.71..289.73 rows=1 width=1,165) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.71..289.71 rows=1 width=1,157) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..260.95 rows=28 width=202) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Append (cost=0.00..100.40 rows=19 width=38) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_orders o_3 (cost=0.00..0.00 rows=1 width=32) (actual rows= loops=)

  • Filter: (shop_id = 80)
24. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_01_03_on_shop_id on shopify_orders_2019_01_03 o_4 (cost=0.29..8.30 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
25. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_03_06_on_shop_id on shopify_orders_2019_03_06 o_5 (cost=0.29..8.31 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
26. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_6 (cost=0.29..16.31 rows=7 width=33) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
27. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_7 (cost=0.29..8.30 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
28. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2018_01_06_on_shop_id on shopify_orders_2018_01_06 o_8 (cost=0.29..8.31 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
29. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2018_06_12_on_shop_id on shopify_orders_2018_06_12 o_9 (cost=0.29..5.66 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
30. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2017_01_06_on_shop_id on shopify_orders_2017_01_06 o_10 (cost=0.14..4.16 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
31. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2017_06_12_on_shop_id on shopify_orders_2017_06_12 o_11 (cost=0.29..8.30 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
32. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2016_01_12_on_shop_id on shopify_orders_2016_01_12 o_12 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
33. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2015_01_12_on_shop_id on shopify_orders_2015_01_12 o_13 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
34. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2014_01_12_on_shop_id on shopify_orders_2014_01_12 o_14 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
35. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2013_on_shop_id on shopify_orders_2013 o_15 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
36. 0.000 0.000 ↓ 0.0

Index Scan using index_shopify_line_items_on_shopify_order_id on shopify_line_items l_1 (cost=0.42..8.44 rows=1 width=172) (actual rows= loops=)

  • Index Cond: (shopify_order_id = o_3.id)
37. 0.000 0.000 ↓ 0.0

Index Scan using index_shopify_refund_line_items_on_shopify_line_item_id on shopify_refund_line_items rl (cost=0.29..1.02 rows=1 width=44) (actual rows= loops=)

  • Index Cond: (shopify_line_item_id = l_1.id)
  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone))
38. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=0.29..324.40 rows=4 width=1,197) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..324.34 rows=4 width=1,189) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Append (cost=0.00..100.40 rows=19 width=38) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_orders o_16 (cost=0.00..0.00 rows=1 width=32) (actual rows= loops=)

  • Filter: (shop_id = 80)
42. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_01_03_on_shop_id on shopify_orders_2019_01_03 o_17 (cost=0.29..8.30 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
43. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_03_06_on_shop_id on shopify_orders_2019_03_06 o_18 (cost=0.29..8.31 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
44. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_19 (cost=0.29..16.31 rows=7 width=33) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
45. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_20 (cost=0.29..8.30 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
46. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2018_01_06_on_shop_id on shopify_orders_2018_01_06 o_21 (cost=0.29..8.31 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
47. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2018_06_12_on_shop_id on shopify_orders_2018_06_12 o_22 (cost=0.29..5.66 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
48. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2017_01_06_on_shop_id on shopify_orders_2017_01_06 o_23 (cost=0.14..4.16 rows=1 width=34) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
49. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2017_06_12_on_shop_id on shopify_orders_2017_06_12 o_24 (cost=0.29..8.30 rows=1 width=29) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
50. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2016_01_12_on_shop_id on shopify_orders_2016_01_12 o_25 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
51. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2015_01_12_on_shop_id on shopify_orders_2015_01_12 o_26 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
52. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2014_01_12_on_shop_id on shopify_orders_2014_01_12 o_27 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
53. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2013_on_shop_id on shopify_orders_2013 o_28 (cost=0.14..8.16 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
54. 0.000 0.000 ↓ 0.0

Index Scan using index_shopify_order_adjustments_on_shopify_order_id on shopify_order_adjustments a (cost=0.29..11.78 rows=1 width=56) (actual rows= loops=)

  • Index Cond: (shopify_order_id = o_16.id)
  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone))
55. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 4 (cost=77.33..77.60 rows=6 width=1,200) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=77.33..77.50 rows=6 width=1,188) (actual rows= loops=)

  • Group Key: o_29.id
57. 0.000 0.000 ↓ 0.0

Sort (cost=77.33..77.35 rows=6 width=81) (actual rows= loops=)

  • Sort Key: o_29.id
58. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.70..77.26 rows=6 width=81) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..75.37 rows=6 width=81) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Append (cost=0.00..24.68 rows=6 width=41) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_orders o_29 (cost=0.00..0.00 rows=1 width=40) (actual rows= loops=)

  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone) AND (shop_id = 80))
62. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_30 (cost=0.29..16.34 rows=4 width=41) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone))
63. 0.000 0.000 ↓ 0.0

Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_31 (cost=0.29..8.31 rows=1 width=42) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-06-29 23:00:00'::timestamp without time zone) AND (created_at <= '2019-09-27 22:59:59'::timestamp without time zone))
64. 0.000 0.000 ↓ 0.0

Index Scan using index_shopify_shipping_lines_on_shopify_order_id on shopify_shipping_lines sl (cost=0.42..8.44 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (shopify_order_id = o_29.id)
65. 0.000 0.000 ↓ 0.0

Index Scan using index_shopify_shipping_tax_lines_on_shopify_shipping_line_id on shopify_shipping_tax_lines s (cost=0.28..0.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (sl.id = shopify_shipping_line_id)