explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qc52 : test

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

Limit (cost=3,007,833.54..3,007,834.04 rows=200 width=292) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=3,007,833.54..3,007,834.04 rows=200 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=2,326,543.40..3,007,825.90 rows=200 width=292) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=2,326,543.40..3,007,823.90 rows=200 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=2,326,543.40..2,329,565.08 rows=1,208,672 width=92) (actual rows= loops=)

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

Subquery Scan on sv (cost=769,920.22..2,080,495.36 rows=1,208,672 width=92) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Append (cost=769,920.22..2,068,408.64 rows=1,208,672 width=1,223) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Result (cost=769,920.22..1,770,145.19 rows=1,208,472 width=1,223) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Append (cost=769,920.22..1,752,018.11 rows=1,208,472 width=1,215) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Result (cost=769,920.22..1,580,891.11 rows=1,109,245 width=1,215) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Append (cost=769,920.22..1,567,025.54 rows=1,109,245 width=1,211) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=769,920.22..1,137,759.91 rows=1,090,898 width=1,055) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Join (cost=769,920.22..1,124,123.68 rows=1,090,898 width=1,051) (actual rows= loops=)

  • Hash Cond: (o.id = l.shopify_order_id)
14. 0.000 0.000 ↓ 0.0

Append (cost=0.00..65,795.33 rows=57,138 width=722) (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

Bitmap Heap Scan on shopify_orders_2019_06_09 o_1 (cost=1,035.87..55,702.57 rows=38,951 width=774) (actual rows= loops=)

  • Recheck 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

Bitmap Index Scan on shopify_orders_2019_06_09_on_shop_id (cost=0.00..1,026.13 rows=47,694 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_09_12 o_2 (cost=401.49..9,807.06 rows=18,186 width=611) (actual rows= loops=)

  • Recheck 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))
19. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_09_12_on_shop_id (cost=0.00..396.95 rows=18,204 width=0) (actual rows= loops=)

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

Hash (cost=527,406.54..527,406.54 rows=5,195,254 width=253) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_line_items l (cost=0.00..527,406.54 rows=5,195,254 width=253) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=260,737.34..423,719.41 rows=18,347 width=1,136) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash Join (cost=260,737.34..423,444.21 rows=18,347 width=1,128) (actual rows= loops=)

  • Hash Cond: (o_3.id = l_1.shopify_order_id)
24. 0.000 0.000 ↓ 0.0

Append (cost=0.00..157,583.67 rows=142,922 width=32) (actual rows= loops=)

25. 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)
26. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on shopify_orders_2019_01_03 o_4 (cost=290.22..11,256.94 rows=13,136 width=32) (actual rows= loops=)

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

Bitmap Index Scan on shopify_orders_2019_01_03_on_shop_id (cost=0.00..286.94 rows=13,136 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_03_06 o_5 (cost=663.07..19,896.79 rows=30,277 width=32) (actual rows= loops=)

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

Bitmap Index Scan on shopify_orders_2019_03_06_on_shop_id (cost=0.00..655.50 rows=30,277 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_06_09 o_6 (cost=1,038.05..55,466.29 rows=47,694 width=33) (actual rows= loops=)

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

Bitmap Index Scan on shopify_orders_2019_06_09_on_shop_id (cost=0.00..1,026.13 rows=47,694 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_09_12 o_7 (cost=401.50..9,716.05 rows=18,204 width=32) (actual rows= loops=)

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

Bitmap Index Scan on shopify_orders_2019_09_12_on_shop_id (cost=0.00..396.95 rows=18,204 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2018_01_06 o_8 (cost=160.54..17,527.33 rows=7,241 width=32) (actual rows= loops=)

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

Bitmap Index Scan on shopify_orders_2018_01_06_on_shop_id (cost=0.00..158.73 rows=7,241 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2018_06_12 o_9 (cost=527.97..35,884.82 rows=24,199 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
37. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2018_06_12_on_shop_id (cost=0.00..521.92 rows=24,199 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2017_01_06 o_10 (cost=5.46..500.49 rows=134 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
39. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2017_01_06_on_shop_id (cost=0.00..5.42 rows=134 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2017_06_12 o_11 (cost=47.91..6,530.74 rows=1,998 width=31) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2017_06_12_on_shop_id (cost=0.00..47.41 rows=1,998 width=0) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
42. 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.42..25.60 rows=7 width=32) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
43. 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.42..49.65 rows=29 width=31) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
44. 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.29..6.07 rows=1 width=31) (actual rows= loops=)

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

Index Scan using shopify_orders_2013_on_shop_id on shopify_orders_2013 o_15 (cost=0.28..8.30 rows=1 width=30) (actual rows= loops=)

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

Hash (cost=259,378.70..259,378.70 rows=34,931 width=185) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..259,378.70 rows=34,931 width=185) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_refund_line_items rl (cost=0.00..4,291.75 rows=34,931 width=44) (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))
49. 0.000 0.000 ↓ 0.0

Index Scan using shopify_line_items_pkey on shopify_line_items l_1 (cost=0.43..7.30 rows=1 width=149) (actual rows= loops=)

  • Index Cond: (id = rl.shopify_line_item_id)
50. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=2,449.76..165,084.65 rows=99,227 width=1,191) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,449.76..163,596.24 rows=99,227 width=1,183) (actual rows= loops=)

  • Hash Cond: (o_16.id = a.shopify_order_id)
52. 0.000 0.000 ↓ 0.0

Append (cost=0.00..157,583.67 rows=142,922 width=32) (actual rows= loops=)

53. 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)
54. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on shopify_orders_2019_01_03 o_17 (cost=290.22..11,256.94 rows=13,136 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
55. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_01_03_on_shop_id (cost=0.00..286.94 rows=13,136 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_03_06 o_18 (cost=663.07..19,896.79 rows=30,277 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
57. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_03_06_on_shop_id (cost=0.00..655.50 rows=30,277 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_06_09 o_19 (cost=1,038.05..55,466.29 rows=47,694 width=33) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
59. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_06_09_on_shop_id (cost=0.00..1,026.13 rows=47,694 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_09_12 o_20 (cost=401.50..9,716.05 rows=18,204 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
61. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_09_12_on_shop_id (cost=0.00..396.95 rows=18,204 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2018_01_06 o_21 (cost=160.54..17,527.33 rows=7,241 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
63. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2018_01_06_on_shop_id (cost=0.00..158.73 rows=7,241 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2018_06_12 o_22 (cost=527.97..35,884.82 rows=24,199 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
65. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2018_06_12_on_shop_id (cost=0.00..521.92 rows=24,199 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2017_01_06 o_23 (cost=5.46..500.49 rows=134 width=32) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
67. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2017_01_06_on_shop_id (cost=0.00..5.42 rows=134 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2017_06_12 o_24 (cost=47.91..6,530.74 rows=1,998 width=31) (actual rows= loops=)

  • Recheck Cond: (shop_id = 80)
69. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2017_06_12_on_shop_id (cost=0.00..47.41 rows=1,998 width=0) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
70. 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.42..25.60 rows=7 width=32) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
71. 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.42..49.65 rows=29 width=31) (actual rows= loops=)

  • Index Cond: (shop_id = 80)
72. 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.29..6.07 rows=1 width=31) (actual rows= loops=)

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

Index Scan using shopify_orders_2013_on_shop_id on shopify_orders_2013 o_28 (cost=0.28..8.30 rows=1 width=30) (actual rows= loops=)

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

Hash (cost=2,098.55..2,098.55 rows=28,096 width=56) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_order_adjustments a (cost=0.00..2,098.55 rows=28,096 width=56) (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))
76. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 4 (cost=292,214.59..292,220.09 rows=200 width=1,200) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

HashAggregate (cost=292,214.59..292,216.59 rows=200 width=1,188) (actual rows= loops=)

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

Hash Right Join (cost=266,996.34..291,336.20 rows=58,559 width=81) (actual rows= loops=)

  • Hash Cond: (s.shopify_shipping_line_id = sl.id)
79. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_shipping_tax_lines s (cost=0.00..15,352.13 rows=596,413 width=16) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

Hash (cost=265,463.35..265,463.35 rows=58,559 width=81) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Hash Join (cost=173,000.33..265,463.35 rows=58,559 width=81) (actual rows= loops=)

  • Hash Cond: (o_29.id = sl.shopify_order_id)
82. 0.000 0.000 ↓ 0.0

Append (cost=0.00..65,795.33 rows=57,138 width=41) (actual rows= loops=)

83. 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))
84. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on shopify_orders_2019_06_09 o_30 (cost=1,035.87..55,702.57 rows=38,951 width=41) (actual rows= loops=)

  • Recheck 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))
85. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_06_09_on_shop_id (cost=0.00..1,026.13 rows=47,694 width=0) (actual rows= loops=)

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

Bitmap Heap Scan on shopify_orders_2019_09_12 o_31 (cost=401.49..9,807.06 rows=18,186 width=40) (actual rows= loops=)

  • Recheck 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))
87. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on shopify_orders_2019_09_12_on_shop_id (cost=0.00..396.95 rows=18,204 width=0) (actual rows= loops=)

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

Hash (cost=113,126.70..113,126.70 rows=2,812,370 width=48) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Seq Scan on shopify_shipping_lines sl (cost=0.00..113,126.70 rows=2,812,370 width=48) (actual rows= loops=)