explain.depesz.com

PostgreSQL's explain analyze made readable

Result: r8L7 : Survey com Places Up

Settings
# exclusive inclusive rows x rows loops node
1. 23.517 414.223 ↓ 1.0 489 1

Nested Loop Left Join (cost=322.07..31,036.19 rows=488 width=196) (actual time=382.120..414.223 rows=489 loops=1)

  • Join Filter: (sr.fk_survey = s.id_survey)
  • Rows Removed by Join Filter: 123961
2. 0.228 6.841 ↓ 1.0 489 1

Hash Left Join (cost=321.64..400.78 rows=488 width=188) (actual time=5.953..6.841 rows=489 loops=1)

  • Hash Cond: (s.id_survey = sa.fk_survey)
3. 0.113 0.728 ↓ 1.0 489 1

Hash Left Join (cost=1.83..78.28 rows=488 width=180) (actual time=0.058..0.728 rows=489 loops=1)

  • Hash Cond: (s.fk_place = p.id_place)
4. 0.586 0.586 ↓ 1.0 489 1

Seq Scan on surveys s (cost=0.00..74.36 rows=488 width=148) (actual time=0.023..0.586 rows=489 loops=1)

  • Filter: (deletedat IS NULL)
  • Rows Removed by Filter: 47
5. 0.012 0.029 ↑ 1.0 37 1

Hash (cost=1.37..1.37 rows=37 width=64) (actual time=0.029..0.029 rows=37 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
6. 0.017 0.017 ↑ 1.0 37 1

Seq Scan on places p (cost=0.00..1.37 rows=37 width=64) (actual time=0.007..0.017 rows=37 loops=1)

7. 0.058 5.885 ↓ 1.1 105 1

Hash (cost=318.62..318.62 rows=95 width=13) (actual time=5.885..5.885 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
8. 0.022 5.827 ↓ 1.1 105 1

Subquery Scan on sa (cost=316.72..318.62 rows=95 width=13) (actual time=5.782..5.827 rows=105 loops=1)

9. 3.645 5.805 ↓ 1.1 105 1

HashAggregate (cost=316.72..317.67 rows=95 width=5) (actual time=5.780..5.805 rows=105 loops=1)

  • Group Key: sa_1.fk_survey
10. 2.160 2.160 ↑ 1.0 7,233 1

Seq Scan on survey_audiences sa_1 (cost=0.00..279.69 rows=7,407 width=5) (actual time=0.008..2.160 rows=7,233 loops=1)

  • Filter: (deletedat IS NULL)
  • Rows Removed by Filter: 61
11. 7.812 383.865 ↓ 127.0 254 489

Materialize (cost=0.42..30,620.77 rows=2 width=13) (actual time=0.766..0.785 rows=254 loops=489)

12. 0.045 376.053 ↓ 127.0 254 1

Subquery Scan on sr (cost=0.42..30,620.76 rows=2 width=13) (actual time=374.470..376.053 rows=254 loops=1)

13. 222.936 376.008 ↓ 127.0 254 1

GroupAggregate (cost=0.42..30,620.74 rows=2 width=5) (actual time=374.468..376.008 rows=254 loops=1)

  • Group Key: sr_1.fk_survey
14. 153.072 153.072 ↓ 1.0 1,004,215 1

Index Only Scan using "IX_survey_responses_fk_survey" on survey_responses sr_1 (cost=0.42..25,725.65 rows=979,015 width=5) (actual time=0.065..153.072 rows=1,004,215 loops=1)

  • Heap Fetches: 0
Planning time : 0.457 ms
Execution time : 414.393 ms