explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fPFV : test

Settings
# exclusive inclusive rows x rows loops node
1. 6.018 2,049.858 ↑ 90.1 9,466 1

Aggregate (cost=4,774,512.77..7,015,185.56 rows=853,041 width=204) (actual time=2,043.393..2,049.858 rows=9,466 loops=1)

  • Buffers: shared hit=302749
2. 8.176 2,043.840 ↑ 1,044.2 1,946 1

Sort (cost=4,774,512.77..4,779,593.03 rows=2,032,103 width=164) (actual time=2,043.379..2,043.84 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. 191.146 2,035.664 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=302749
4. 1.295 1,844.518 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=291061
5. 2.275 1,843.220 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=291061
6. 1.348 1,840.945 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=291061
7. 2.107 1,839.595 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=291061
8. 1.193 1,837.488 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=291061
9. 2.778 1,836.293 ↑ 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=1.281..1,836.293 rows=1,946 loops=1)

  • Buffers: shared hit=291061
10. 1,793.352 1,833.515 ↑ 1,044.2 1,946 1

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

  • Buffers: shared hit=291061
11. 0.962 4.809 ↑ 1.1 1,607 1

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

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

Seq Scan on shopify_orders o (cost=0..0 rows=1 width=779) (actual time=0.002..0.003 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. 3.679 3.832 ↑ 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.188..3.832 rows=1,607 loops=1)

  • Filter: (o_1.shop_id = 5)
  • Buffers: shared hit=313
14. 0.153 0.153 ↓ 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.152..0.153 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.006..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.005 0.005 ↓ 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.005 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. 11.249 35.354 ↑ 8.0 1 1,607

Append (cost=0..14.72 rows=8 width=200) (actual time=0.006..0.022 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..0.001 rows=0 loops=1)