explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U1qn

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 151.202 ↓ 0.0 0 1

Merge Join (cost=10,700.55..11,151.16 rows=2 width=97) (actual time=151.202..151.202 rows=0 loops=1)

  • Merge Cond: ((rating_answers.user_id)::text = (response_demographics.user_id)::text)
2. 0.021 151.173 ↑ 2.0 1 1

GroupAggregate (cost=10,700.00..10,700.06 rows=2 width=73) (actual time=151.172..151.173 rows=1 loops=1)

  • Group Key: rating_answers.user_id
  • Filter: (count(rating_answers.rating) = 5)
3. 76.952 151.152 ↓ 3.0 6 1

Sort (cost=10,700.00..10,700.00 rows=2 width=29) (actual time=151.150..151.152 rows=6 loops=1)

  • Sort Key: rating_answers.user_id
  • Sort Method: quicksort Memory: 1282kB
4. 74.200 74.200 ↓ 5,746.5 11,493 1

Index Scan using pk_rating_answers on rating_answers (cost=0.70..10,699.99 rows=2 width=29) (actual time=0.027..74.200 rows=11,493 loops=1)

  • Index Cond: (((survey_id)::text = '57d9897bdb4d0846fd000000'::text) AND (question_id = ANY ('{0cfa86ca-57d9-d351-2363-8dd454000532,37342cac-57d9-d36c-4f2a-e5a08b000bc5,a95fbbdd-57d9-d33b-4f2a-e55f120002d7,cfbd6076-57d9-d383-2363-8d067b000818,e76c04fe-57d9-d397-2363-8dd454000535}'::uuid[])))
  • Filter: (rating = ANY ('{1,2,3,4,5}'::integer[]))
5. 0.002 0.027 ↓ 0.0 0 1

GroupAggregate (cost=0.55..448.73 rows=186 width=57) (actual time=0.026..0.027 rows=0 loops=1)

  • Group Key: response_demographics.user_id
6. 0.025 0.025 ↓ 0.0 0 1

Index Scan using pk_response_demographics on response_demographics (cost=0.55..445.48 rows=186 width=50) (actual time=0.025..0.025 rows=0 loops=1)

  • Index Cond: ((survey_id)::text = '57d9897bdb4d0846fd000000'::text)
Planning time : 0.249 ms
Execution time : 151.271 ms