explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kQ5K : View Survey

Settings
# exclusive inclusive rows x rows loops node
1. 0.191 484.670 ↓ 1.0 489 1

Hash Left Join (cost=322.07..31,036.19 rows=488 width=196) (actual time=451.092..484.670 rows=489 loops=1)

  • Hash Cond: (s.fk_place = p.id_place)
2. 0.241 484.445 ↓ 1.0 489 1

Hash Left Join (cost=320.24..31,032.27 rows=488 width=164) (actual time=451.037..484.445 rows=489 loops=1)

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

Nested Loop Left Join (cost=0.42..30,709.77 rows=488 width=156) (actual time=446.280..479.472 rows=489 loops=1)

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

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

  • Filter: (deletedat IS NULL)
  • Rows Removed by Filter: 47
5. 8.173 454.281 ↓ 127.0 254 489

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

6. 0.047 446.108 ↓ 127.0 254 1

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

7. 268.098 446.061 ↓ 127.0 254 1

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

  • Group Key: sr_1.fk_survey
8. 177.963 177.963 ↓ 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.050..177.963 rows=1,004,215 loops=1)

  • Heap Fetches: 0
9. 0.033 4.732 ↓ 1.1 105 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
10. 0.018 4.699 ↓ 1.1 105 1

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

11. 2.805 4.681 ↓ 1.1 105 1

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

  • Group Key: sa_1.fk_survey
12. 1.876 1.876 ↑ 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.013..1.876 rows=7,233 loops=1)

  • Filter: (deletedat IS NULL)
  • Rows Removed by Filter: 61
13. 0.018 0.034 ↑ 1.0 37 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
14. 0.016 0.016 ↑ 1.0 37 1

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

Planning time : 0.508 ms
Execution time : 484.920 ms