explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GSQDH

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 2,538.693 ↑ 1.0 51 1

Merge Left Join (cost=222,601.38..222,601.84 rows=51 width=147) (actual time=2,538.666..2,538.693 rows=51 loops=1)

  • Merge Cond: (outfit.id_outfit = outfit_star_count.id_outfit)
2. 0.013 2,538.671 ↑ 1.0 51 1

Merge Left Join (cost=222,578.60..222,578.89 rows=51 width=143) (actual time=2,538.652..2,538.671 rows=51 loops=1)

  • Merge Cond: (outfit.id_outfit = outfit_comment_count.id_outfit)
3. 0.044 2,538.269 ↑ 1.0 51 1

Sort (cost=222,555.82..222,555.95 rows=51 width=139) (actual time=2,538.262..2,538.269 rows=51 loops=1)

  • Sort Key: outfit.id_outfit
  • Sort Method: quicksort Memory: 37kB
4. 0.010 2,538.225 ↑ 1.0 51 1

Limit (cost=222,553.74..222,553.86 rows=51 width=139) (actual time=2,538.203..2,538.225 rows=51 loops=1)

5. 231.391 2,538.215 ↑ 20,163.9 51 1

Sort (cost=222,553.74..225,124.63 rows=1,028,357 width=139) (actual time=2,538.203..2,538.215 rows=51 loops=1)

  • Sort Key: outfit.outfit_post_datetime DESC
  • Sort Method: top-N heapsort Memory: 37kB
6. 439.986 2,306.824 ↑ 1.0 1,000,000 1

GroupAggregate (cost=0.57..188,245.56 rows=1,028,357 width=139) (actual time=1.837..2,306.824 rows=1,000,000 loops=1)

  • Group Key: outfit.id_outfit
7. 169.300 1,866.838 ↑ 1.0 1,000,000 1

Merge Left Join (cost=0.57..172,820.20 rows=1,028,357 width=135) (actual time=1.521..1,866.838 rows=1,000,000 loops=1)

  • Merge Cond: (outfit.id_outfit = outfit_items.id_outfit)
8. 1,697.181 1,697.181 ↑ 1.0 1,000,000 1

Index Scan using outfit_pkey on outfit (cost=0.42..170,188.36 rows=1,028,357 width=131) (actual time=1.162..1,697.181 rows=1,000,000 loops=1)

  • Filter: ((deleted_at IS NULL) AND (eg_result = 1))
9. 0.357 0.357 ↓ 0.0 0 1

Index Scan using outfit_item_idx on detection_item outfit_items (cost=0.15..60.90 rows=4 width=4) (actual time=0.357..0.357 rows=0 loops=1)

  • Filter: (deleted_at IS NULL)
10. 0.010 0.389 ↓ 0.0 0 1

Sort (cost=22.78..22.79 rows=6 width=8) (actual time=0.389..0.389 rows=0 loops=1)

  • Sort Key: outfit_comment_count.id_outfit
  • Sort Method: quicksort Memory: 25kB
11. 0.379 0.379 ↓ 0.0 0 1

Seq Scan on outfit_comment_count (cost=0.00..22.70 rows=6 width=8) (actual time=0.379..0.379 rows=0 loops=1)

  • Filter: (deleted_at IS NULL)
12. 0.009 0.012 ↓ 0.0 0 1

Sort (cost=22.78..22.79 rows=6 width=8) (actual time=0.012..0.012 rows=0 loops=1)

  • Sort Key: outfit_star_count.id_outfit
  • Sort Method: quicksort Memory: 25kB
13. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on outfit_star_count (cost=0.00..22.70 rows=6 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Filter: (deleted_at IS NULL)
Planning time : 0.354 ms
Execution time : 2,538.792 ms