explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9kQG

Settings
# exclusive inclusive rows x rows loops node
1. 0.555 9,456.365 ↓ 1.9 1,112 1

Finalize GroupAggregate (cost=259,596.36..259,893.27 rows=586 width=28) (actual time=8,816.929..9,456.365 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.473 9,455.810 ↓ 1.2 2,071 1

Gather Merge (cost=259,596.36..259,840.53 rows=1,758 width=20) (actual time=8,811.602..9,455.810 rows=2,071 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 342.792 9,393.337 ↑ 1.7 1,036 2 / 2

Partial GroupAggregate (cost=258,596.35..258,642.74 rows=1,758 width=20) (actual time=8,741.449..9,393.337 rows=1,036 loops=2)

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

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

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: external merge Disk: 33,512kB
  • Worker 0: Sort Method: external merge Disk: 32,400kB
5. 1,818.587 8,011.986 ↓ 615.1 1,772,140 2 / 2

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

6. 269.586 876.977 ↓ 57.7 1,772,140 2 / 2

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

7. 4.913 7.882 ↓ 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=3.050..7.882 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=765
8. 0.021 2.969 ↓ 0.0 0 1 / 2

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

9. 0.672 0.672 ↑ 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.344..1.344 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. 2.276 2.276 ↓ 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=4.551..4.551 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.004..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.851 ms
Execution time : 9,461.664 ms