explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7zG1

Settings
# exclusive inclusive rows x rows loops node
1. 3.430 592,583.741 ↓ 177.0 177 1

GroupAggregate (cost=3,993.73..3,993.77 rows=1 width=28) (actual time=592,578.778..592,583.741 rows=177 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: 22
2. 34.557 592,580.311 ↓ 33,950.0 33,950 1

Sort (cost=3,993.73..3,993.74 rows=1 width=9) (actual time=592,578.744..592,580.311 rows=33,950 loops=1)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: quicksort Memory: 3,128kB
3. 83,900.972 592,545.754 ↓ 33,950.0 33,950 1

Nested Loop (cost=844.47..3,993.72 rows=1 width=9) (actual time=981.295..592,545.754 rows=33,950 loops=1)

  • Join Filter: (survey_sentemployeegroup_takers.surveytaker_id = "ANY_subquery".surveytaker_id)
  • Rows Removed by Join Filter: 1,597,887,915
4. 595.727 3,017.842 ↓ 393,484.0 393,484 1

Nested Loop (cost=843.90..3,115.82 rows=1 width=13) (actual time=0.628..3,017.842 rows=393,484 loops=1)

5. 122.910 354.770 ↓ 7,253.8 413,469 1

Nested Loop (cost=843.47..3,088.54 rows=57 width=8) (actual time=0.611..354.770 rows=413,469 loops=1)

6. 1.841 2.383 ↓ 198.2 1,189 1

Bitmap Heap Scan on survey_sentemployeegroup (cost=842.90..867.02 rows=6 width=8) (actual time=0.556..2.383 rows=1,189 loops=1)

  • Recheck Cond: ((instance_id = 25,335) AND (category_id = ANY ('{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=72
7. 0.027 0.542 ↓ 0.0 0 1

BitmapAnd (cost=842.90..842.90 rows=6 width=0) (actual time=0.542..0.542 rows=0 loops=1)

8. 0.435 0.435 ↓ 2.9 9,740 1

Bitmap Index Scan on survey_sentemployeegroup_instance_id (cost=0.00..93.43 rows=3,316 width=0) (actual time=0.435..0.435 rows=9,740 loops=1)

  • Index Cond: (instance_id = 25,335)
9. 0.080 0.080 ↑ 22.5 1,189 1

Bitmap Index Scan on survey_sentemployeegroup_category_id (cost=0.00..749.21 rows=26,777 width=0) (actual time=0.080..0.080 rows=1,189 loops=1)

  • Index Cond: (category_id = ANY ('{146892,145818,144180,144179,144178,144177,144176,144175,144174,144173,144076,144075,144074,144073,144072}'::integer[]))
10. 229.477 229.477 ↑ 12.7 348 1,189

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers (cost=0.57..326.10 rows=4,415 width=8) (actual time=0.011..0.193 rows=348 loops=1,189)

  • Index Cond: (sentemployeegroup_id = survey_sentemployeegroup.id)
  • Heap Fetches: 0
11. 2,067.345 2,067.345 ↑ 1.0 1 413,469

Index Scan using survey_surveytaker_pkey on survey_surveytaker (cost=0.43..0.48 rows=1 width=5) (actual time=0.005..0.005 rows=1 loops=413,469)

  • Index Cond: (id = survey_sentemployeegroup_takers.surveytaker_id)
  • Filter: ((complete OR (NOT skip_when_counting) OR (skip_when_counting IS NULL)) AND (instance_id = 25,335))
  • Rows Removed by Filter: 0
12. 145,982.564 505,626.940 ↑ 1.0 4,061 393,484

Subquery Scan on ANY_subquery (cost=0.57..825.32 rows=4,207 width=4) (actual time=0.001..1.285 rows=4,061 loops=393,484)

13. 359,630.335 359,644.376 ↑ 1.0 4,061 393,484

HashSetOp Intersect (cost=0.57..783.25 rows=4,207 width=8) (actual time=0.001..0.914 rows=4,061 loops=393,484)

14. 3.537 14.041 ↓ 6.2 52,676 1

Append (cost=0.57..762.12 rows=8,450 width=8) (actual time=0.019..14.041 rows=52,676 loops=1)

15. 3.992 9.644 ↓ 11.5 48,432 1

Subquery Scan on *SELECT* 1 (cost=0.57..359.94 rows=4,225 width=8) (actual time=0.018..9.644 rows=48,432 loops=1)

16. 5.652 5.652 ↓ 11.5 48,432 1

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers survey_sentemployeegroup_takers_1 (cost=0.57..317.69 rows=4,225 width=4) (actual time=0.018..5.652 rows=48,432 loops=1)

  • Index Cond: (sentemployeegroup_id = 42,684,578)
  • Heap Fetches: 0
17. 0.347 0.860 ↓ 1.0 4,244 1

Subquery Scan on *SELECT* 2 (cost=0.57..359.94 rows=4,225 width=8) (actual time=0.032..0.860 rows=4,244 loops=1)

18. 0.513 0.513 ↓ 1.0 4,244 1

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers survey_sentemployeegroup_takers_2 (cost=0.57..317.69 rows=4,225 width=4) (actual time=0.031..0.513 rows=4,244 loops=1)

  • Index Cond: (sentemployeegroup_id = 42,802,206)
  • Heap Fetches: 0
Planning time : 2.154 ms
Execution time : 592,584.571 ms