explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 87f2

Settings
# exclusive inclusive rows x rows loops node
1. 130.344 3,304.928 ↓ 343.0 1,029 1

GroupAggregate (cost=84,766.45..84,766.72 rows=3 width=28) (actual time=3,118.091..3,304.928 rows=1,029 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: 31
2. 268.544 3,174.584 ↓ 128,713.0 1,029,704 1

Sort (cost=84,766.45..84,766.47 rows=8 width=9) (actual time=3,118.069..3,174.584 rows=1,029,704 loops=1)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: quicksort Memory: 72,844kB
3. 519.795 2,906.040 ↓ 128,713.0 1,029,704 1

Nested Loop (cost=2,825.88..84,766.33 rows=8 width=9) (actual time=1.071..2,906.040 rows=1,029,704 loops=1)

4. 115.951 277.303 ↓ 2,000.9 1,054,471 1

Nested Loop (cost=2,825.44..83,019.26 rows=527 width=8) (actual time=1.051..277.303 rows=1,054,471 loops=1)

5. 1.846 2.811 ↓ 63.6 3,687 1

Bitmap Heap Scan on survey_sentemployeegroup (cost=2,824.88..3,059.89 rows=58 width=8) (actual time=1.021..2.811 rows=3,687 loops=1)

  • Recheck Cond: ((instance_id = ANY ('{25335,24152,21363}'::integer[])) AND (category_id = ANY ('{145980,114963,114964,114965,114966,114817,114818,114819,114820,114821,114822,99670,99671,99672,99673,99738,99739,99740,99741,99742,118189,113906,113907,113908,113909,113910,113911,113912,113913,99743,146247,134616,129328,129329,129330,129331,129367,129368,129369,129370,129371,129372,129373,146892,145818,144180,144179,144178,144177,144176,144175,144174,144173,144076,144075,144074,144073,144072}'::integer[])))
  • Filter: (original_id IS NOT NULL)
  • Heap Blocks: exact=445
6. 0.064 0.965 ↓ 0.0 0 1

BitmapAnd (cost=2,824.88..2,824.88 rows=58 width=0) (actual time=0.965..0.965 rows=0 loops=1)

7. 0.591 0.591 ↓ 1.4 12,286 1

Bitmap Index Scan on survey_sentemployeegroup_instance_id (cost=0.00..237.16 rows=8,998 width=0) (actual time=0.591..0.591 rows=12,286 loops=1)

  • Index Cond: (instance_id = ANY ('{25335,24152,21363}'::integer[]))
8. 0.310 0.310 ↑ 25.4 3,687 1

Bitmap Index Scan on survey_sentemployeegroup_category_id (cost=0.00..2,587.44 rows=93,726 width=0) (actual time=0.310..0.310 rows=3,687 loops=1)

  • Index Cond: (category_id = ANY ('{145980,114963,114964,114965,114966,114817,114818,114819,114820,114821,114822,99670,99671,99672,99673,99738,99739,99740,99741,99742,118189,113906,113907,113908,113909,113910,113911,113912,113913,99743,146247,134616,129328,129329,129330,129331,129367,129368,129369,129370,129371,129372,129373,146892,145818,144180,144179,144178,144177,144176,144175,144174,144173,144076,144075,144074,144073,144072}'::integer[]))
9. 158.541 158.541 ↑ 14.4 286 3,687

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers (cost=0.57..1,337.31 rows=4,130 width=8) (actual time=0.005..0.043 rows=286 loops=3,687)

  • Index Cond: (sentemployeegroup_id = survey_sentemployeegroup.id)
  • Heap Fetches: 5,838
10. 2,108.942 2,108.942 ↑ 1.0 1 1,054,471

Index Scan using survey_surveytaker_pkey on survey_surveytaker (cost=0.43..3.32 rows=1 width=5) (actual time=0.002..0.002 rows=1 loops=1,054,471)

  • 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 ('{25335,24152,21363}'::integer[])))
  • Rows Removed by Filter: 0
Planning time : 0.663 ms
Execution time : 3,310.917 ms