explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iNaS : test

Settings
# exclusive inclusive rows x rows loops node
1. 1.581 1,937.852 ↑ 126.5 1,607 1

Aggregate (cost=4,774,512.77..5,335,372.42 rows=203,210 width=204) (actual time=1,935.858..1,937.852 rows=1,607 loops=1)

  • Buffers: shared hit=302749
2. 7.492 1,936.271 ↑ 1,044.2 1,946 1

Sort (cost=4,774,512.77..4,779,593.03 rows=2,032,103 width=164) (actual time=1,935.844..1,936.271 rows=1,946 loops=1)

  • Sort Key: sv.email, sv.number, (order_month(sv.id)), (to_char(sv.created_at, 'MM-DD-YYYY'::text)), (order_day(sv.id)), sv.name
  • Sort Method: quicksort Memory: 322kB
  • Buffers: shared hit=302749
3. 181.345 1,928.779 ↑ 1,044.2 1,946 1

Subquery Scan on sv (cost=0..4,228,207.83 rows=2,032,103 width=164) (actual time=4.138..1,928.779 rows=1,946 loops=1)

  • Buffers: shared hit=302749
4. 1.237 1,747.434 ↑ 1,044.2 1,946 1

Append (cost=0..3,186,755.04 rows=2,032,103 width=1,223) (actual time=2.46..1,747.434 rows=1,946 loops=1)

  • Buffers: shared hit=291061
5. 2.092 1,746.194 ↑ 1,044.2 1,946 1

Result (cost=0..3,176,593.5 rows=2,032,102 width=1,223) (actual time=2.459..1,746.194 rows=1,946 loops=1)

  • Buffers: shared hit=291061
6. 1.300 1,744.102 ↑ 1,044.2 1,946 1

Append (cost=0..3,146,111.97 rows=2,032,102 width=1,215) (actual time=2.457..1,744.102 rows=1,946 loops=1)

  • Buffers: shared hit=291061
7. 2.090 1,742.800 ↑ 1,044.2 1,946 1

Result (cost=0..3,135,951.45 rows=2,032,101 width=1,215) (actual time=2.456..1,742.8 rows=1,946 loops=1)

  • Buffers: shared hit=291061
8. 1.144 1,740.710 ↑ 1,044.2 1,946 1

Append (cost=0..3,110,550.19 rows=2,032,101 width=1,211) (actual time=2.453..1,740.71 rows=1,946 loops=1)

  • Buffers: shared hit=291061
9. 2.703 1,739.564 ↑ 1,044.2 1,946 1

Subquery Scan on *SELECT* 1 (cost=0..3,100,389.68 rows=2,032,100 width=877) (actual time=2.452..1,739.564 rows=1,946 loops=1)

  • Buffers: shared hit=291061
10. 1,697.886 1,736.861 ↑ 1,044.2 1,946 1

Nested Loop (cost=0..3,074,988.43 rows=2,032,100 width=873) (actual time=2.449..1,736.861 rows=1,946 loops=1)

  • Buffers: shared hit=291061
11. 0.929 5.228 ↑ 1.1 1,607 1

Append (cost=0..1,002.03 rows=1,746 width=550) (actual time=0.185..5.228 rows=1,607 loops=1)

  • Buffers: shared hit=317
12. 0.002 0.002 ↓ 0.0 0 1

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

  • Filter: ((o.created_at >= '2019-01-01 18:30:00'::timestamp without time zone) AND (o.created_at <= '2019-02-01 06:18:05.33'::timestamp without time zone) AND (o.shop_id = 5))
13. 4.138 4.286 ↑ 1.1 1,607 1

Bitmap Heap Scan on shopify_orders_2019_01_06 o_1 (cost=53.43..976.67 rows=1,743 width=550) (actual time=0.183..4.286 rows=1,607 loops=1)

  • Filter: (o_1.shop_id = 5)
  • Buffers: shared hit=313
14. 0.148 0.148 ↓ 1.0 2,074 1

Bitmap Index Scan on shopify_orders_2019_01_06_created_at (cost=0..52.99 rows=2,071 width=0) (actual time=0.148..0.148 rows=2,074 loops=1)

  • Index Cond: ((o_1.created_at >= '2019-01-01 18:30:00'::timestamp without time zone) AND (o_1.created_at <= '2019-02-01 06:18:05.33'::timestamp without time zone))
  • Buffers: shared hit=9
15. 0.007 0.007 ↓ 0.0 0 1

Index Scan using shopify_orders_2018_06_12_created_at on shopify_orders_2018_06_12 o_2 (cost=0.29..8.31 rows=1 width=542) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((o_2.created_at >= '2019-01-01 18:30:00'::timestamp without time zone) AND (o_2.created_at <= '2019-02-01 06:18:05.33'::timestamp without time zone))
  • Filter: (o_2.shop_id = 5)
  • Buffers: shared hit=2
16. 0.004 0.004 ↓ 0.0 0 1

Index Scan using shopify_orders_2017_06_12_created_at on shopify_orders_2017_06_12 o_3 (cost=0.29..8.31 rows=1 width=563) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((o_3.created_at >= '2019-01-01 18:30:00'::timestamp without time zone) AND (o_3.created_at <= '2019-02-01 06:18:05.33'::timestamp without time zone))
  • Filter: (o_3.shop_id = 5)
  • Buffers: shared hit=2
17. 9.642 33.747 ↑ 8.0 1 1,607

Append (cost=0..14.72 rows=8 width=200) (actual time=0.006..0.021 rows=1 loops=1,607)

  • Buffers: shared hit=19356
18. 0.000 0.000 ↓ 0.0 0 1,607

Seq Scan on shopify_line_items l (cost=0..0 rows=1 width=304) (actual time=0..0 rows=0 loops=1,607)

  • Filter: (o.id = l.shopify_order_id)
19. 8.035 8.035 ↑ 1.0 1 1,607

Index Scan using shopify_line_items_2019_01_06_on_shopify_order_id on shopify_line_items_2019_01_06 l_1 (cost=0.29..1.56 rows=1 width=207) (actual time=0.003..0.005 rows=1 loops=1,607)

  • Index Cond: (l_1.shopify_order_id = o.id)
  • Buffers: shared hit=4893
20. 4.821 4.821 ↓ 0.0 0 1,607

Index Scan using shopify_line_items_2019_06_12_on_shopify_order_id on shopify_line_items_2019_06_12 l_2 (cost=0.29..3.03 rows=2 width=184) (actual time=0.003..0.003 rows=0 loops=1,607)

  • Index Cond: (l_2.shopify_order_id = o.id)
  • Buffers: shared hit=3214
21. 3.214 3.214 ↓ 0.0 0 1,607

Index Scan using shopify_line_items_2018_01_06_on_shopify_order_id on shopify_line_items_2018_01_06 l_3 (cost=0.29..4.05 rows=1 width=206) (actual time=0.002..0.002 rows=0 loops=1,607)

  • Index Cond: (l_3.shopify_order_id = o.id)
  • Buffers: shared hit=3214
22. 3.214 3.214 ↓ 0.0 0 1,607

Index Scan using shopify_line_items_2018_06_12_on_shopify_order_id on shopify_line_items_2018_06_12 l_4 (cost=0.29..3.07 rows=1 width=204) (actual time=0.002..0.002 rows=0 loops=1,607)

  • Index Cond: (l_4.shopify_order_id = o.id)
  • Buffers: shared hit=3214
23. 1.607 1.607 ↓ 0.0 0 1,607

Index Scan using shopify_line_items_2017_01_06_on_shopify_order_id on shopify_line_items_2017_01_06 l_5 (cost=0.14..0.19 rows=1 width=304) (actual time=0.001..0.001 rows=0 loops=1,607)

  • Index Cond: (l_5.shopify_order_id = o.id)
  • Buffers: shared hit=1607
24. 3.214 3.214 ↓ 0.0 0 1,607

Index Scan using shopify_line_items_2017_06_12_on_shopify_order_id on shopify_line_items_2017_06_12 l_6 (cost=0.29..2.79 rows=1 width=191) (actual time=0.002..0.002 rows=0 loops=1,607)

  • Index Cond: (l_6.shopify_order_id = o.id)
  • Buffers: shared hit=3214
25. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0..0 rows=1 width=1,169) (actual time=0.002..0.002 rows=0 loops=1)

26. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0..0 rows=0 width=1,165) (actual time=0.001..0.001 rows=0 loops=1)

27. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=0..0.01 rows=1 width=1,190) (actual time=0.001..0.002 rows=0 loops=1)

28. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0..0 rows=0 width=1,182) (actual time=0.001..0.001 rows=0 loops=1)

29. 0.001 0.003 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=0..1.03 rows=1 width=1,198) (actual time=0.003..0.003 rows=0 loops=1)

30. 0.001 0.002 ↓ 0.0 0 1

Aggregate (cost=0..1.01 rows=1 width=1,186) (actual time=0.002..0.002 rows=0 loops=1)

31. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0..0 rows=0 width=47) (actual time=0.001..0.001 rows=0 loops=1)