explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v6Sy

Settings
# exclusive inclusive rows x rows loops node
1. 0.762 9,542.281 ↓ 1.9 1,112 1

Finalize GroupAggregate (cost=259,596.36..259,893.27 rows=586 width=28) (actual time=8,826.820..9,542.281 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. 96.220 9,541.519 ↓ 1.2 2,076 1

Gather Merge (cost=259,596.36..259,840.53 rows=1,758 width=20) (actual time=8,818.957..9,541.519 rows=2,076 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 371.422 9,445.299 ↑ 1.7 1,038 2 / 2

Partial GroupAggregate (cost=258,596.35..258,642.74 rows=1,758 width=20) (actual time=8,763.135..9,445.299 rows=1,038 loops=2)

  • Group Key: survey_sentemployeegroup.original_id
4. 1,034.856 9,073.877 ↓ 615.1 1,772,140 2 / 2

Sort (cost=258,596.35..258,603.56 rows=2,881 width=9) (actual time=8,757.847..9,073.877 rows=1,772,140 loops=2)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: external merge Disk: 32,408kB
  • Worker 0: Sort Method: external merge Disk: 33,504kB
5. 1,849.202 8,039.021 ↓ 615.1 1,772,140 2 / 2

Nested Loop (cost=3,585.32..258,430.81 rows=2,881 width=9) (actual time=5.081..8,039.021 rows=1,772,140 loops=2)

6. 264.141 873.397 ↓ 57.7 1,772,140 2 / 2

Nested Loop (cost=3,584.89..243,900.73 rows=30,734 width=8) (actual time=5.058..873.397 rows=1,772,140 loops=2)

7. 5.734 9.747 ↓ 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=5.021..9.747 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=176
8. 0.058 4.013 ↓ 0.0 0 1 / 2

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

9. 0.851 0.851 ↑ 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.703..1.703 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.104 3.104 ↓ 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.209..6.209 rows=124,544 loops=1)

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

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

  • Index Cond: (sentemployeegroup_id = survey_sentemployeegroup.id)
  • Heap Fetches: 826,057
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.880 ms
Execution time : 9,546.865 ms