explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Saj4

Settings
# exclusive inclusive rows x rows loops node
1. 0.756 9,651.366 ↓ 1.9 1,112 1

Finalize GroupAggregate (cost=259,626.68..259,923.59 rows=586 width=28) (actual time=9,028.356..9,651.366 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. 39.995 9,650.610 ↓ 1.2 2,055 1

Gather Merge (cost=259,626.68..259,870.85 rows=1,758 width=20) (actual time=9,017.686..9,650.610 rows=2,055 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 369.572 9,610.615 ↑ 1.7 1,028 2 / 2

Partial GroupAggregate (cost=258,626.67..258,673.06 rows=1,758 width=20) (actual time=8,934.701..9,610.615 rows=1,028 loops=2)

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

Sort (cost=258,626.67..258,633.88 rows=2,881 width=9) (actual time=8,934.048..9,241.043 rows=1,772,140 loops=2)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: external merge Disk: 32,384kB
  • Worker 0: Sort Method: external merge Disk: 33,528kB
5. 1,976.669 8,198.369 ↓ 615.1 1,772,140 2 / 2

Nested Loop (cost=3,585.32..258,461.13 rows=2,881 width=9) (actual time=5.068..8,198.369 rows=1,772,140 loops=2)

6. 273.381 905.278 ↓ 57.7 1,772,140 2 / 2

Nested Loop (cost=3,584.89..243,929.22 rows=30,738 width=8) (actual time=5.045..905.278 rows=1,772,140 loops=2)

7. 5.748 9.764 ↓ 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.013..9.764 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=645
8. 0.020 4.016 ↓ 0.0 0 1 / 2

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

9. 0.842 0.842 ↑ 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.684..1.684 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.154 3.154 ↓ 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.308..6.308 rows=124,544 loops=1)

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

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers (cost=0.57..189.72 rows=3,624 width=8) (actual time=0.004..0.055 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 : 1.703 ms
Execution time : 9,656.215 ms