explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w4ZS : test

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1.440 ↓ 0.0 0 1

Limit (cost=543.06..543.06 rows=1 width=196) (actual time=1.440..1.440 rows=0 loops=1)

2. 0.711 1.439 ↓ 0.0 0 1

Sort (cost=543.06..543.06 rows=1 width=196) (actual time=1.439..1.439 rows=0 loops=1)

  • Sort Key: tmp."Order Name", tmp.order_discr
  • Sort Method: quicksort Memory: 25kB
3. 0.001 0.728 ↓ 0.0 0 1

Subquery Scan on tmp (cost=542.62..543.05 rows=1 width=196) (actual time=0.728..0.728 rows=0 loops=1)

4. 0.002 0.727 ↓ 0.0 0 1

GroupAggregate (cost=542.62..543.04 rows=1 width=232) (actual time=0.727..0.727 rows=0 loops=1)

  • Group Key: sv.name, (to_char(timezone('America/New_York'::text, timezone('utc'::text, sv.created_at)), 'MM-DD-YYYY'::text)), sv.email
  • Filter: (CASE WHEN ((GROUPING(sv.name) = 0) AND (GROUPING((to_char(timezone('America/New_York'::text, timezone('utc'::text, sv.created_at)), 'MM-DD-YYYY'::text))) = 0) AND (GROUPING(sv.email) = 0)) THEN 1 ELSE 0 END = 1)
5. 0.498 0.725 ↓ 0.0 0 1

Sort (cost=542.62..542.64 rows=7 width=108) (actual time=0.725..0.725 rows=0 loops=1)

  • Sort Key: sv.name, (to_char(timezone('America/New_York'::text, timezone('utc'::text, sv.created_at)), 'MM-DD-YYYY'::text)), sv.email
  • Sort Method: quicksort Memory: 25kB
6. 0.001 0.227 ↓ 0.0 0 1

Subquery Scan on sv (cost=0.42..542.52 rows=7 width=108) (actual time=0.227..0.227 rows=0 loops=1)

7. 0.001 0.226 ↓ 0.0 0 1

Append (cost=0.42..542.40 rows=7 width=1,223) (actual time=0.226..0.226 rows=0 loops=1)

8. 0.001 0.210 ↓ 0.0 0 1

Result (cost=0.42..512.74 rows=5 width=1,223) (actual time=0.210..0.210 rows=0 loops=1)

9. 0.000 0.209 ↓ 0.0 0 1

Append (cost=0.42..512.67 rows=5 width=1,215) (actual time=0.209..0.209 rows=0 loops=1)

10. 0.001 0.168 ↓ 0.0 0 1

Result (cost=0.42..251.10 rows=4 width=1,215) (actual time=0.168..0.168 rows=0 loops=1)

11. 0.000 0.167 ↓ 0.0 0 1

Append (cost=0.42..251.05 rows=4 width=1,211) (actual time=0.167..0.167 rows=0 loops=1)

12. 0.000 0.035 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=0.42..28.94 rows=3 width=1,064) (actual time=0.035..0.035 rows=0 loops=1)

13. 0.001 0.035 ↓ 0.0 0 1

Nested Loop (cost=0.42..28.91 rows=3 width=1,060) (actual time=0.034..0.035 rows=0 loops=1)

14. 0.001 0.034 ↓ 0.0 0 1

Append (cost=0.00..12.00 rows=2 width=710) (actual time=0.034..0.034 rows=0 loops=1)

15. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on shopify_orders o (cost=0.00..0.00 rows=1 width=779) (actual time=0.002..0.003 rows=0 loops=1)

  • Filter: ((created_at >= '2019-08-01 04:00:00'::timestamp without time zone) AND (created_at <= '2019-08-15 03:59:59'::timestamp without time zone) AND (shop_id = 1))
16. 0.030 0.030 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_1 (cost=0.29..11.99 rows=1 width=642) (actual time=0.030..0.030 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
  • Filter: ((created_at >= '2019-08-01 04:00:00'::timestamp without time zone) AND (created_at <= '2019-08-15 03:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 2
17. 0.000 0.000 ↓ 0.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) (never executed)

  • Index Cond: (shopify_order_id = o.id)
18. 0.001 0.132 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.71..222.09 rows=1 width=1,161) (actual time=0.132..0.132 rows=0 loops=1)

19. 0.002 0.131 ↓ 0.0 0 1

Nested Loop (cost=0.71..222.07 rows=1 width=1,153) (actual time=0.131..0.131 rows=0 loops=1)

20. 0.006 0.123 ↑ 8.3 3 1

Nested Loop (cost=0.42..201.65 rows=25 width=198) (actual time=0.051..0.123 rows=3 loops=1)

21. 0.003 0.099 ↑ 8.5 2 1

Append (cost=0.00..58.00 rows=17 width=34) (actual time=0.034..0.099 rows=2 loops=1)

22. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on shopify_orders o_2 (cost=0.00..0.00 rows=1 width=56) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (shop_id = 1)
23. 0.015 0.015 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_01_03_on_shop_id on shopify_orders_2019_01_03 o_3 (cost=0.29..8.30 rows=1 width=34) (actual time=0.014..0.015 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
24. 0.014 0.014 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_03_06_on_shop_id on shopify_orders_2019_03_06 o_4 (cost=0.29..8.31 rows=1 width=34) (actual time=0.014..0.014 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
25. 0.006 0.006 ↑ 4.0 2 1

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_5 (cost=0.29..11.95 rows=8 width=33) (actual time=0.004..0.006 rows=2 loops=1)

  • Index Cond: (shop_id = 1)
26. 0.012 0.012 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_6 (cost=0.29..5.32 rows=1 width=34) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
27. 0.007 0.007 ↓ 0.0 0 1

Index Scan using shopify_orders_2018_01_06_on_shop_id on shopify_orders_2018_01_06 o_7 (cost=0.29..8.31 rows=1 width=32) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
28. 0.012 0.012 ↓ 0.0 0 1

Index Scan using shopify_orders_2018_06_12_on_shop_id on shopify_orders_2018_06_12 o_8 (cost=0.29..4.95 rows=1 width=32) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
29. 0.006 0.006 ↓ 0.0 0 1

Index Scan using shopify_orders_2017_01_06_on_shop_id on shopify_orders_2017_01_06 o_9 (cost=0.14..4.16 rows=1 width=34) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
30. 0.007 0.007 ↓ 0.0 0 1

Index Scan using shopify_orders_2017_06_12_on_shop_id on shopify_orders_2017_06_12 o_10 (cost=0.29..4.41 rows=1 width=29) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
31. 0.016 0.016 ↓ 0.0 0 1

Seq Scan on shopify_orders_2016_01_12 o_11 (cost=0.00..2.20 rows=1 width=33) (actual time=0.016..0.016 rows=0 loops=1)

  • Filter: (shop_id = 1)
  • Rows Removed by Filter: 16
32. 0.018 0.018 ↓ 2.0 2 2

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 time=0.008..0.009 rows=2 loops=2)

  • Index Cond: (shopify_order_id = o_2.id)
33. 0.006 0.006 ↓ 0.0 0 3

Index Scan using index_shopify_refund_line_items_on_shopify_line_item_id on shopify_refund_line_items rl (cost=0.29..0.81 rows=1 width=44) (actual time=0.002..0.002 rows=0 loops=3)

  • Index Cond: (shopify_line_item_id = l_1.id)
  • Filter: ((created_at >= '2019-08-01 04:00:00'::timestamp without time zone) AND (created_at <= '2019-08-15 03:59:59'::timestamp without time zone))
34. 0.001 0.041 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=0.29..261.54 rows=1 width=1,193) (actual time=0.041..0.041 rows=0 loops=1)

35. 0.001 0.040 ↓ 0.0 0 1

Nested Loop (cost=0.29..261.53 rows=1 width=1,185) (actual time=0.040..0.040 rows=0 loops=1)

36. 0.002 0.031 ↑ 8.5 2 1

Append (cost=0.00..58.00 rows=17 width=34) (actual time=0.010..0.031 rows=2 loops=1)

37. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on shopify_orders o_12 (cost=0.00..0.00 rows=1 width=56) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (shop_id = 1)
38. 0.003 0.003 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_01_03_on_shop_id on shopify_orders_2019_01_03 o_13 (cost=0.29..8.30 rows=1 width=34) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
39. 0.002 0.002 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_03_06_on_shop_id on shopify_orders_2019_03_06 o_14 (cost=0.29..8.31 rows=1 width=34) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
40. 0.005 0.005 ↑ 4.0 2 1

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_15 (cost=0.29..11.95 rows=8 width=33) (actual time=0.003..0.005 rows=2 loops=1)

  • Index Cond: (shop_id = 1)
41. 0.003 0.003 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_16 (cost=0.29..5.32 rows=1 width=34) (actual time=0.002..0.003 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
42. 0.002 0.002 ↓ 0.0 0 1

Index Scan using shopify_orders_2018_01_06_on_shop_id on shopify_orders_2018_01_06 o_17 (cost=0.29..8.31 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
43. 0.002 0.002 ↓ 0.0 0 1

Index Scan using shopify_orders_2018_06_12_on_shop_id on shopify_orders_2018_06_12 o_18 (cost=0.29..4.95 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
44. 0.002 0.002 ↓ 0.0 0 1

Index Scan using shopify_orders_2017_01_06_on_shop_id on shopify_orders_2017_01_06 o_19 (cost=0.14..4.16 rows=1 width=34) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
45. 0.002 0.002 ↓ 0.0 0 1

Index Scan using shopify_orders_2017_06_12_on_shop_id on shopify_orders_2017_06_12 o_20 (cost=0.29..4.41 rows=1 width=29) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
46. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on shopify_orders_2016_01_12 o_21 (cost=0.00..2.20 rows=1 width=33) (actual time=0.007..0.007 rows=0 loops=1)

  • Filter: (shop_id = 1)
  • Rows Removed by Filter: 16
47. 0.008 0.008 ↓ 0.0 0 2

Index Scan using index_shopify_order_adjustments_on_shopify_order_id on shopify_order_adjustments a (cost=0.29..11.96 rows=1 width=56) (actual time=0.004..0.004 rows=0 loops=2)

  • Index Cond: (shopify_order_id = o_12.id)
  • Filter: ((created_at >= '2019-08-01 04:00:00'::timestamp without time zone) AND (created_at <= '2019-08-15 03:59:59'::timestamp without time zone))
48. 0.001 0.015 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=29.53..29.62 rows=2 width=1,211) (actual time=0.014..0.015 rows=0 loops=1)

49. 0.001 0.014 ↓ 0.0 0 1

GroupAggregate (cost=29.53..29.59 rows=2 width=1,199) (actual time=0.014..0.014 rows=0 loops=1)

  • Group Key: o_22.id
50. 0.006 0.013 ↓ 0.0 0 1

Sort (cost=29.53..29.54 rows=2 width=92) (actual time=0.013..0.013 rows=0 loops=1)

  • Sort Key: o_22.id
  • Sort Method: quicksort Memory: 25kB
51. 0.001 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..29.52 rows=2 width=92) (actual time=0.007..0.007 rows=0 loops=1)

52. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=0.42..28.89 rows=2 width=92) (actual time=0.006..0.006 rows=0 loops=1)

53. 0.001 0.006 ↓ 0.0 0 1

Append (cost=0.00..12.00 rows=2 width=52) (actual time=0.006..0.006 rows=0 loops=1)

54. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on shopify_orders o_22 (cost=0.00..0.00 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((created_at >= '2019-08-01 04:00:00'::timestamp without time zone) AND (created_at <= '2019-08-15 03:59:59'::timestamp without time zone) AND (shop_id = 1))
55. 0.004 0.004 ↓ 0.0 0 1

Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_23 (cost=0.29..11.99 rows=1 width=41) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: (shop_id = 1)
  • Filter: ((created_at >= '2019-08-01 04:00:00'::timestamp without time zone) AND (created_at <= '2019-08-15 03:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 2
56. 0.000 0.000 ↓ 0.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) (never executed)

  • Index Cond: (shopify_order_id = o_22.id)
57. 0.000 0.000 ↓ 0.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) (never executed)

  • Index Cond: (sl.id = shopify_shipping_line_id)
Planning time : 4.195 ms
Execution time : 1.875 ms