explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cmWpC

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 18,257.758 ↓ 16.6 1,112 1

Finalize GroupAggregate (cost=4,795,381.26..4,797,577.10 rows=67 width=28) (actual time=17,202.792..18,257.758 rows=1,112 loops=1)

  • Group Key: survey_sentemployeegroup_takers.original_id
  • Filter: (count(survey_sentemployeegroup_takers.surveytaker_id) FILTER (WHERE survey_surveytaker.complete) > 0)
  • Rows Removed by Filter: 16
2. 179.355 18,260.400 ↓ 8.2 3,283 1

Gather Merge (cost=4,795,381.26..4,797,568.10 rows=400 width=20) (actual time=17,173.822..18,260.400 rows=3,283 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 550.726 18,081.045 ↓ 5.5 1,094 3 / 3

Partial GroupAggregate (cost=4,794,381.23..4,796,521.90 rows=200 width=20) (actual time=17,121.251..18,081.045 rows=1,094 loops=3)

  • Group Key: survey_sentemployeegroup_takers.original_id
4. 1,347.510 17,530.319 ↓ 5.5 1,181,427 3 / 3

Sort (cost=4,794,381.23..4,794,915.90 rows=213,867 width=9) (actual time=17,116.082..17,530.319 rows=1,181,427 loops=3)

  • Sort Key: survey_sentemployeegroup_takers.original_id
  • Sort Method: quicksort Memory: 97,375kB
  • Worker 0: Sort Method: quicksort Memory: 98,374kB
  • Worker 1: Sort Method: quicksort Memory: 101,462kB
5. 965.253 16,182.809 ↓ 5.5 1,181,427 3 / 3

Parallel Hash Join (cost=315,561.75..4,775,447.21 rows=213,867 width=9) (actual time=9,618.959..16,182.809 rows=1,181,427 loops=3)

  • Hash Cond: (survey_sentemployeegroup_takers.surveytaker_id = survey_surveytaker.id)
6. 14,883.733 14,883.733 ↑ 1.9 1,181,427 3 / 3

Parallel Seq Scan on survey_sentemployeegroup_takers (cost=0.00..4,453,896.00 rows=2,281,694 width=8) (actual time=9,274.413..14,883.733 rows=1,181,427 loops=3)

  • Filter: ((original_id IS NOT NULL) AND (category_id = ANY ('{33638,30419,30420,30416,30422,30415,30418,30421,30440,30439,30438,30427,30414,30449,30436,30434,30432,30431,30430,30429,30428,30424,30423,30433,30435,30426,30442,30437,30425,30417,33637,32343,32347,32344,32345,32349,32346,32348,32342,32340,32350,32341,34750,34749,33636,33130,33128,33141,33140,33139,33138,33137,33136,33135,33134,33133,33132,33131,33129,33127,37441,37440,37375,37369,36513,36447,36446,36449,36448,36445,36444,36443,36442,36441,36440,38156,38054,38053,38052,38051,38050,38049,38048,38047,38046,38045,38044}'::integer[])))
  • Rows Removed by Filter: 24,736,488
7. 93.873 333.823 ↑ 1.3 109,878 3 / 3

Parallel Hash (cost=313,759.63..313,759.63 rows=144,170 width=5) (actual time=333.823..333.823 rows=109,878 loops=3)

  • Buckets: 524,288 Batches: 1 Memory Usage: 17,056kB
8. 239.950 239.950 ↑ 1.3 109,878 3 / 3

Parallel Index Scan using survey_surveytaker_instance_id on survey_surveytaker (cost=0.43..313,759.63 rows=144,170 width=5) (actual time=1.713..239.950 rows=109,878 loops=3)

  • Index Cond: (instance_id = ANY ('{10288,10131,9995,9938,9828}'::integer[]))
  • Filter: (complete OR (NOT skip_when_counting) OR (skip_when_counting IS NULL))
Planning time : 0.519 ms
Execution time : 18,266.517 ms