explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ShUm

Settings
# exclusive inclusive rows x rows loops node
1. 60.244 975.560 ↓ 2.0 2 1

GroupAggregate (cost=59.43..59.46 rows=1 width=210) (actual time=920.999..975.560 rows=2 loops=1)

  • Group Key: styles.id, style_colors.id, style_sizes.id
2. 225.607 915.316 ↓ 187,770.0 187,770 1

Sort (cost=59.43..59.44 rows=1 width=178) (actual time=867.374..915.316 rows=187,770 loops=1)

  • Sort Key: styles.id, style_sizes.id
  • Sort Method: quicksort Memory: 56021kB
3. 113.139 689.709 ↓ 187,770.0 187,770 1

Nested Loop (cost=4.00..59.42 rows=1 width=178) (actual time=1.101..689.709 rows=187,770 loops=1)

4. 56.300 107.145 ↓ 93,885.0 93,885 1

Nested Loop Left Join (cost=3.44..55.58 rows=1 width=178) (actual time=1.088..107.145 rows=93,885 loops=1)

  • Filter: ((accounts_collections.account_id = 6941) OR (items.account_id = 6941) OR ((matches.account_id = 6941) AND (matches.active = 1) AND (NOT collections.is_custom)))
  • Rows Removed by Filter: 9876
5. 0.092 0.823 ↓ 15.8 63 1

Nested Loop Left Join (cost=3.01..31.05 rows=4 width=191) (actual time=0.072..0.823 rows=63 loops=1)

6. 0.087 0.542 ↓ 63.0 63 1

Nested Loop (cost=2.58..19.50 rows=1 width=191) (actual time=0.063..0.542 rows=63 loops=1)

7. 0.059 0.266 ↓ 63.0 63 1

Nested Loop Left Join (cost=2.16..19.05 rows=1 width=187) (actual time=0.054..0.266 rows=63 loops=1)

8. 0.008 0.078 ↓ 3.0 3 1

Nested Loop Left Join (cost=1.73..18.39 rows=1 width=183) (actual time=0.046..0.078 rows=3 loops=1)

9. 0.006 0.049 ↓ 3.0 3 1

Nested Loop Left Join (cost=1.30..17.93 rows=1 width=182) (actual time=0.037..0.049 rows=3 loops=1)

10. 0.007 0.029 ↑ 1.0 1 1

Nested Loop (cost=0.87..16.91 rows=1 width=178) (actual time=0.027..0.029 rows=1 loops=1)

11. 0.013 0.013 ↑ 1.0 1 1

Index Scan using style_colors_pkey on style_colors (cost=0.43..8.45 rows=1 width=12) (actual time=0.011..0.013 rows=1 loops=1)

  • Index Cond: (id = 6586479)
12. 0.009 0.009 ↑ 1.0 1 1

Index Scan using styles_pkey on styles (cost=0.43..8.45 rows=1 width=166) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: (id = style_colors.style_id)
  • Filter: ((deleted <> 1) OR (deleted IS NULL))
13. 0.014 0.014 ↑ 5.3 3 1

Index Scan using collections_styles_style_id_idx on collections_styles (cost=0.43..0.87 rows=16 width=8) (actual time=0.008..0.014 rows=3 loops=1)

  • Index Cond: (styles.id = style_id)
14. 0.021 0.021 ↑ 1.0 1 3

Index Scan using collections_pkey on collections (cost=0.42..0.46 rows=1 width=5) (actual time=0.007..0.007 rows=1 loops=3)

  • Index Cond: (collections_styles.collection_id = id)
15. 0.129 0.129 ↓ 4.2 21 3

Index Scan using item_style_id_idx on items (cost=0.43..0.62 rows=5 width=8) (actual time=0.006..0.043 rows=21 loops=3)

  • Index Cond: (styles.id = style_id)
16. 0.189 0.189 ↑ 1.0 1 63

Index Only Scan using accounts_pkey on accounts t8 (cost=0.42..0.44 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=63)

  • Index Cond: (id = styles.designer_id)
  • Heap Fetches: 0
17. 0.189 0.189 ↓ 0.0 0 63

Index Only Scan using accounts_collections_pkey on accounts_collections (cost=0.43..7.52 rows=403 width=8) (actual time=0.003..0.003 rows=0 loops=63)

  • Index Cond: (collection_id = collections.id)
  • Heap Fetches: 0
18. 50.022 50.022 ↓ 11.8 1,647 63

Index Scan using matches_other_account_id_idx on matches (cost=0.43..3.33 rows=140 width=12) (actual time=0.006..0.794 rows=1,647 loops=63)

  • Index Cond: (t8.id = other_account_id)
19. 469.425 469.425 ↓ 2.0 2 93,885

Index Scan using style_sizes_style_id_idx on style_sizes (cost=0.56..3.83 rows=1 width=8) (actual time=0.002..0.005 rows=2 loops=93,885)

  • Index Cond: (style_id = styles.id)
  • Filter: ((id = 18087747) OR (id = 18087748))
  • Rows Removed by Filter: 3
Planning time : 3.248 ms