explain.depesz.com

PostgreSQL's explain analyze made readable

Result: opu5

Settings
# exclusive inclusive rows x rows loops node
1. 1.006 10,587.746 ↓ 1.9 1,112 1

Finalize GroupAggregate (cost=337,250.48..337,547.29 rows=586 width=28) (actual time=10,034.395..10,587.746 rows=1,112 loops=1)

  • Group Key: survey_sentemployeegroup.original_id
  • Filter: (count(survey_sentemployeegroup_takers.surveytaker_id) FILTER (WHERE survey_surveytaker.complete) > 0)
  • Rows Removed by Filter: 16
2. 62.237 10,586.740 ↓ 1.2 2,064 1

Gather Merge (cost=337,250.48..337,494.55 rows=1,758 width=20) (actual time=10,018.409..10,586.740 rows=2,064 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 335.869 10,524.503 ↑ 1.7 1,032 2 / 2

Partial GroupAggregate (cost=336,250.47..336,296.77 rows=1,758 width=20) (actual time=9,910.665..10,524.503 rows=1,032 loops=2)

  • Group Key: survey_sentemployeegroup.original_id
4. 1,017.414 10,188.634 ↓ 617.0 1,772,140 2 / 2

Sort (cost=336,250.47..336,257.65 rows=2,872 width=9) (actual time=9,910.016..10,188.634 rows=1,772,140 loops=2)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: external merge Disk: 33,008kB
  • Worker 0: Sort Method: external merge Disk: 32,904kB
5. 2,140.608 9,171.220 ↓ 617.0 1,772,140 2 / 2

Nested Loop (cost=3,585.32..336,085.50 rows=2,872 width=9) (actual time=5.038..9,171.220 rows=1,772,140 loops=2)

6. 267.647 1,714.190 ↓ 57.8 1,772,140 2 / 2

Nested Loop (cost=3,584.89..321,595.36 rows=30,646 width=8) (actual time=5.015..1,714.190 rows=1,772,140 loops=2)

7. 5.955 9.983 ↓ 10.9 11,312 2 / 2

Parallel Bitmap Heap Scan on survey_sentemployeegroup (cost=3,584.33..9,830.51 rows=1,036 width=8) (actual time=4.981..9.983 rows=11,312 loops=2)

  • Recheck Cond: ((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[])) AND (instance_id = ANY ('{10288,10131,9995,9938,9828}'::integer[])))
  • Filter: (original_id IS NOT NULL)
  • Heap Blocks: exact=641
8. 0.022 4.029 ↓ 0.0 0 1 / 2

BitmapAnd (cost=3,584.33..3,584.33 rows=1,761 width=0) (actual time=8.057..8.057 rows=0 loops=1)

9. 0.883 0.883 ↑ 1.6 22,623 1 / 2

Bitmap Index Scan on survey_sentemployeegroup_category_id (cost=0.00..1,009.33 rows=37,312 width=0) (actual time=1.766..1.766 rows=22,623 loops=1)

  • Index Cond: (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[]))
10. 3.123 3.123 ↓ 1.0 124,544 1 / 2

Bitmap Index Scan on survey_sentemployeegroup_instance_id (cost=0.00..2,573.86 rows=123,695 width=0) (actual time=6.247..6.247 rows=124,544 loops=1)

  • Index Cond: (instance_id = ANY ('{10288,10131,9995,9938,9828}'::integer[]))
11. 1,436.561 1,436.561 ↑ 23.7 157 22,623 / 2

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers (cost=0.57..263.74 rows=3,719 width=8) (actual time=0.005..0.127 rows=157 loops=22,623)

  • Index Cond: (sentemployeegroup_id = survey_sentemployeegroup.id)
  • Heap Fetches: 3,544,281
12. 5,316.422 5,316.422 ↑ 1.0 1 3,544,281 / 2

Index Scan using survey_surveytaker_pkey on survey_surveytaker (cost=0.43..0.47 rows=1 width=5) (actual time=0.003..0.003 rows=1 loops=3,544,281)

  • Index Cond: (id = survey_sentemployeegroup_takers.surveytaker_id)
  • Filter: ((complete OR (NOT skip_when_counting) OR (skip_when_counting IS NULL)) AND (instance_id = ANY ('{10288,10131,9995,9938,9828}'::integer[])))
Planning time : 0.746 ms
Execution time : 10,594.157 ms