explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V8T2

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 39.113 ↓ 7.0 21 1

Sort (cost=71,022.29..71,022.3 rows=3 width=219) (actual time=39.111..39.113 rows=21 loops=1)

  • Sort Key: ss.style_id, ss.order_nbr, ss.id
  • Sort Method: quicksort Memory: 27kB
  • Buffers: shared hit=36,002
2. 0.013 39.086 ↓ 7.0 21 1

Nested Loop (cost=70,390.41..71,022.27 rows=3 width=219) (actual time=36.699..39.086 rows=21 loops=1)

  • Buffers: shared hit=36,002
3. 0.009 39.073 ↓ 7.0 21 1

Nested Loop (cost=70,390.13..71,021.38 rows=3 width=76) (actual time=36.695..39.073 rows=21 loops=1)

  • Buffers: shared hit=36,002
4. 0.593 39.014 ↓ 5.0 5 1

Hash Join (cost=70,389.57..70,964.79 rows=1 width=8) (actual time=36.674..39.014 rows=5 loops=1)

  • Buffers: shared hit=35,975
5. 4.576 38.384 ↑ 3.0 8,402 1

HashAggregate (cost=70,363.26..70,617.5 rows=25,424 width=8) (actual time=36.631..38.384 rows=8,402 loops=1)

  • Group Key: s.id, ud.user_id
  • Buffers: shared hit=35,953
6. 1.051 33.808 ↑ 3.0 8,411 1

Append (cost=0.86..70,236.14 rows=25,424 width=8) (actual time=0.027..33.808 rows=8,411 loops=1)

  • Buffers: shared hit=35,953
7. 1.200 8.422 ↓ 4.6 2,378 1

Nested Loop (cost=0.86..634.48 rows=513 width=8) (actual time=0.026..8.422 rows=2,378 loops=1)

  • Buffers: shared hit=10,307
8. 0.271 2.466 ↓ 4.6 2,378 1

Nested Loop (cost=0.43..353.22 rows=513 width=8) (actual time=0.019..2.466 rows=2,378 loops=1)

  • Buffers: shared hit=780
9. 0.033 0.033 ↑ 1.0 1 1

Seq Scan on users_divisions ud (cost=0..6.75 rows=1 width=8) (actual time=0.007..0.033 rows=1 loops=1)

  • Filter: (ud.user_id = 709,127)
  • Buffers: shared hit=3
10. 2.162 2.162 ↓ 2.9 2,378 1

Index Only Scan using divisions_styles_unique_1_idx on divisions_styles ds (cost=0.43..338.13 rows=834 width=8) (actual time=0.01..2.162 rows=2,378 loops=1)

  • Index Cond: (ds.division_id = ud.division_id)
  • Heap Fetches: 2,378
  • Buffers: shared hit=777
11. 4.756 4.756 ↑ 1.0 1 2,378

Index Only Scan using styles_id_incl_designer_id_idx on styles s (cost=0.43..0.55 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=2,378)

  • Index Cond: (s.id = ds.style_id)
  • Heap Fetches: 2,378
  • Buffers: shared hit=9,527
12. 4.648 24.335 ↑ 4.1 6,033 1

Nested Loop (cost=379.61..69,220.29 rows=24,911 width=8) (actual time=0.548..24.335 rows=6,033 loops=1)

  • Buffers: shared hit=25,646
13. 0.652 7.621 ↑ 4.1 6,033 1

Nested Loop (cost=379.17..57,072.82 rows=24,911 width=8) (actual time=0.54..7.621 rows=6,033 loops=1)

  • Buffers: shared hit=4,243
14. 0.011 0.011 ↑ 1.0 2 1

Index Only Scan using unique_user_category on users_categories uc (cost=0.28..11.74 rows=2 width=8) (actual time=0.007..0.011 rows=2 loops=1)

  • Index Cond: (uc.user_id = 709,127)
  • Heap Fetches: 2
  • Buffers: shared hit=4
15. 6.170 6.958 ↑ 5.1 3,016 2

Bitmap Heap Scan on categories_styles cs (cost=378.9..28,377.68 rows=15,286 width=8) (actual time=0.63..3.479 rows=3,016 loops=2)

  • Heap Blocks: exact=4,206
  • Buffers: shared hit=4,239
16. 0.788 0.788 ↑ 5.0 3,086 2

Bitmap Index Scan on categories_styles_category_id_idx (cost=0..375.08 rows=15,286 width=0) (actual time=0.394..0.394 rows=3,086 loops=2)

  • Index Cond: (cs.category_id = uc.category_id)
  • Buffers: shared hit=33
17. 12.066 12.066 ↑ 1.0 1 6,033

Index Only Scan using styles_id_incl_designer_id_idx on styles s_1 (cost=0.43..0.49 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=6,033)

  • Index Cond: (s_1.id = cs.style_id)
  • Heap Fetches: 1,269
  • Buffers: shared hit=21,403
18. 0.003 0.037 ↑ 1.0 5 1

Hash (cost=26.25..26.25 rows=5 width=4) (actual time=0.037..0.037 rows=5 loops=1)

  • Buffers: shared hit=22
19. 0.034 0.034 ↑ 1.0 5 1

Index Only Scan using styles_id_incl_designer_id_idx on styles st (cost=0.43..26.25 rows=5 width=4) (actual time=0.014..0.034 rows=5 loops=1)

  • Index Cond: (st.id = ANY ('{5583619,8799200,7614893,2519420,8774652}'::integer[]))
  • Heap Fetches: 3
  • Buffers: shared hit=22
20. 0.050 0.050 ↑ 39.8 4 5

Index Scan using style_sizes_style_id_idx on style_sizes ss (cost=0.56..54.6 rows=159 width=72) (actual time=0.008..0.01 rows=4 loops=5)

  • Index Cond: (ss.style_id = s.id)
  • Filter: ((ss.deleted = 0) AND (ss.active = 1))
  • Buffers: shared hit=27
21. 0.000 0.000 ↓ 0.0 0 21

Index Scan using casepacks_pkey on casepacks cpk (cost=0.28..0.3 rows=1 width=147) (actual time=0..0 rows=0 loops=21)

  • Index Cond: (cpk.id = ss.casepack_id)
Planning time : 1.69 ms
Execution time : 39.34 ms