explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UJMk

Settings
# exclusive inclusive rows x rows loops node
1. 349.755 848,528.778 ↑ 639,500.8 62 1

Hash Join (cost=4,536,558.20..4,566,528.06 rows=39,649,052 width=97) (actual time=843,377.429..848,528.778 rows=62 loops=1)

  • Hash Cond: ((response_demographics.user_id)::text = (q1.user_id)::text)
2. 1,362.929 29,178.460 ↓ 1.6 1,076,116 1

GroupAggregate (cost=348,511.55..370,005.06 rows=668,449 width=57) (actual time=24,369.822..29,178.460 rows=1,076,116 loops=1)

  • Group Key: response_demographics.user_id
3. 16,635.631 27,815.531 ↑ 1.0 1,750,226 1

Sort (cost=348,511.55..352,890.85 rows=1,751,720 width=50) (actual time=24,369.774..27,815.531 rows=1,750,226 loops=1)

  • Sort Key: response_demographics.user_id
  • Sort Method: external merge Disk: 102800kB
4. 11,179.900 11,179.900 ↑ 1.0 1,750,226 1

Seq Scan on response_demographics (cost=0.00..47,106.20 rows=1,751,720 width=50) (actual time=1.164..11,179.900 rows=1,750,226 loops=1)

5. 14.500 819,000.563 ↑ 179.7 66 1

Hash (cost=4,187,898.36..4,187,898.36 rows=11,863 width=65) (actual time=819,000.563..819,000.563 rows=66 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 136kB
6. 0.043 818,986.063 ↑ 179.7 66 1

Subquery Scan on q1 (cost=4,187,405.72..4,187,898.36 rows=11,863 width=65) (actual time=818,973.466..818,986.063 rows=66 loops=1)

7. 13.379 818,986.020 ↑ 179.7 66 1

GroupAggregate (cost=4,187,405.72..4,187,779.73 rows=11,863 width=73) (actual time=818,973.463..818,986.020 rows=66 loops=1)

  • Group Key: rating_answers.user_id
  • Filter: (count(rating_answers.rating) = 5)
  • Rows Removed by Filter: 4781
8. 140.714 818,972.641 ↓ 1.1 14,797 1

Sort (cost=4,187,405.72..4,187,438.40 rows=13,071 width=29) (actual time=818,968.692..818,972.641 rows=14,797 loops=1)

  • Sort Key: rating_answers.user_id
  • Sort Method: quicksort Memory: 1541kB
9. 25.913 818,831.927 ↓ 1.1 14,797 1

Gather (cost=1,000.00..4,186,512.05 rows=13,071 width=29) (actual time=40,618.641..818,831.927 rows=14,797 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 818,806.014 818,806.014 ↑ 1.1 4,932 3

Parallel Seq Scan on rating_answers (cost=0.00..4,184,204.95 rows=5,446 width=29) (actual time=530,558.399..818,806.014 rows=4,932 loops=3)

  • Filter: ((question_id = ANY ('{543f259d-4e6d-8a66-784c-ea6768000042,8b6f4ffe-4e6d-8a66-784c-ea6768000044,d637a847-4e6d-8a65-784c-ea676800001e,e2fdb312-4e6d-8a66-784c-ea6768000043,f5ad207a-4e6d-8a66-784c-ea6768000045}'::uuid[])) AND (rating = ANY ('{1,2,3,4,5}'::integer[])))
  • Rows Removed by Filter: 60495049
Planning time : 0.749 ms
Execution time : 848,543.444 ms