explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ak1x

Settings
# exclusive inclusive rows x rows loops node
1. 0.228 380,036.192 ↑ 1.0 500 1

Subquery Scan on final_tmp (cost=440,142.47..440,812.47 rows=500 width=319) (actual time=373,840.199..380,036.192 rows=500 loops=1)

2. 0.149 380,035.964 ↑ 1.0 500 1

Limit (cost=440,142.47..440,807.47 rows=500 width=359) (actual time=373,840.198..380,035.964 rows=500 loops=1)

3. 6,311.243 380,035.815 ↑ 1.2 500 1

Result (cost=440,142.47..440,971.06 rows=623 width=359) (actual time=373,840.196..380,035.815 rows=500 loops=1)

4. 3.245 373,724.572 ↑ 1.2 500 1

Sort (cost=440,142.47..440,144.02 rows=623 width=267) (actual time=373,724.386..373,724.572 rows=500 loops=1)

  • Sort Key: (to_char(timezone('America/Denver'::text, timezone('utc'::text, t.created_at)), 'MM-DD-YYYY HH24:MI'::text))
  • Sort Method: quicksort Memory: 170kB
5. 5.969 373,721.327 ↑ 1.1 546 1

Nested Loop Left Join (cost=0.99..440,113.55 rows=623 width=267) (actual time=227.305..373,721.327 rows=546 loops=1)

6. 1.372 373,571.214 ↓ 1.0 546 1

Nested Loop (cost=0.56..438,823.77 rows=524 width=123) (actual time=226.673..373,571.214 rows=546 loops=1)

7. 369,895.808 369,895.808 ↓ 1.0 546 1

Index Scan using index_shopify_transactions_on_shop_id on shopify_transactions t (cost=0.56..419,547.09 rows=524 width=79) (actual time=225.834..369,895.808 rows=546 loops=1)

  • Index Cond: (shop_id = 701)
  • Filter: ((created_at >= '2020-07-28 06:00:00'::timestamp without time zone) AND (created_at <= '2020-07-29 05:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 736,107
8. 4.914 3,674.034 ↑ 17.0 1 546

Append (cost=0.00..36.62 rows=17 width=52) (actual time=6.728..6.729 rows=1 loops=546)

9. 0.000 0.000 ↓ 0.0 0 546

Seq Scan on shopify_orders o (cost=0.00..0.00 rows=1 width=52) (actual time=0.000..0.000 rows=0 loops=546)

  • Filter: (t.shopify_order_id = id)
10. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2019_01_03_pkey on shopify_orders_2019_01_03 o_1 (cost=0.42..2.41 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
11. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2019_03_06_pkey on shopify_orders_2019_03_06 o_2 (cost=0.43..2.43 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
12. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2019_06_09_pkey on shopify_orders_2019_06_09 o_3 (cost=0.43..2.44 rows=1 width=53) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
13. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2019_09_12_pkey on shopify_orders_2019_09_12 o_4 (cost=0.43..2.44 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
14. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2018_01_06_pkey on shopify_orders_2018_01_06 o_5 (cost=0.43..2.42 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
15. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2018_06_12_pkey on shopify_orders_2018_06_12 o_6 (cost=0.43..2.43 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
16. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2017_01_06_pkey on shopify_orders_2017_01_06 o_7 (cost=0.42..2.36 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
17. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2017_06_12_pkey on shopify_orders_2017_06_12 o_8 (cost=0.43..2.42 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
18. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2016_01_12_pkey on shopify_orders_2016_01_12 o_9 (cost=0.42..2.38 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
19. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2015_01_12_pkey on shopify_orders_2015_01_12 o_10 (cost=0.42..2.26 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
20. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2014_01_12_pkey on shopify_orders_2014_01_12 o_11 (cost=0.42..2.23 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
21. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_2013_pkey on shopify_orders_2013 o_12 (cost=0.42..2.22 rows=1 width=51) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
22. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_shopify_orders_2020_01_03_pkey on shopify_orders_2020_01_03 o_13 (cost=0.43..2.44 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
23. 76.986 76.986 ↓ 0.0 0 546

Index Scan using shopify_orders_2020_03_06_pkey on shopify_orders_2020_03_06 o_14 (cost=0.43..2.44 rows=1 width=52) (actual time=0.141..0.141 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
24. 3,584.490 3,584.490 ↑ 1.0 1 546

Index Scan using shopify_orders_shopify_orders_2020_06_09_pkey on shopify_orders_2020_06_09 o_15 (cost=0.43..2.44 rows=1 width=52) (actual time=6.565..6.565 rows=1 loops=546)

  • Index Cond: (id = t.shopify_order_id)
25. 0.546 0.546 ↓ 0.0 0 546

Index Scan using shopify_orders_shopify_orders_2020_09_12_pkey on shopify_orders_2020_09_12 o_16 (cost=0.14..0.76 rows=1 width=76) (actual time=0.001..0.001 rows=0 loops=546)

  • Index Cond: (id = t.shopify_order_id)
26. 144.144 144.144 ↓ 0.0 0 546

Index Scan using index_shopify_refunds_on_shopify_order_id on shopify_refunds r (cost=0.43..2.41 rows=1 width=16) (actual time=0.264..0.264 rows=0 loops=546)

  • Index Cond: (t.shopify_order_id = shopify_order_id)
Planning time : 120.978 ms
Execution time : 380,037.290 ms