explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aLA0

Settings
# exclusive inclusive rows x rows loops node
1. 354.380 11,158.753 ↓ 15.0 1,112 1

GroupAggregate (cost=75,932.10..75,937.11 rows=74 width=12) (actual time=10,477.983..11,158.753 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. 1,215.472 10,804.373 ↓ 15,893.6 3,544,281 1

Sort (cost=75,932.10..75,932.65 rows=223 width=9) (actual time=10,476.868..10,804.373 rows=3,544,281 loops=1)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: external merge Disk: 65,904kB
3. 1,293.431 9,588.901 ↓ 15,893.6 3,544,281 1

Nested Loop (cost=9,943.59..75,923.40 rows=223 width=9) (actual time=13.285..9,588.901 rows=3,544,281 loops=1)

4. 825.962 1,206.908 ↓ 1,487.9 3,544,281 1

Hash Join (cost=9,943.16..73,848.72 rows=2,382 width=8) (actual time=13.265..1,206.908 rows=3,544,281 loops=1)

  • Hash Cond: (survey_sentemployeegroup_takers.sentemployeegroup_id = survey_sentemployeegroup.id)
5. 367.702 367.702 ↑ 1.0 3,544,281 1

Seq Scan on tmp_group_takers survey_sentemployeegroup_takers (cost=0.00..54,601.81 rows=3,544,281 width=8) (actual time=0.014..367.702 rows=3,544,281 loops=1)

6. 3.221 13.244 ↓ 12.8 22,623 1

Hash (cost=9,921.15..9,921.15 rows=1,761 width=8) (actual time=13.243..13.244 rows=22,623 loops=1)

  • Buckets: 32,768 (originally 2048) Batches: 1 (originally 1) Memory Usage: 1,140kB
7. 4.553 10.023 ↓ 12.8 22,623 1

Bitmap Heap Scan on survey_sentemployeegroup (cost=3,584.33..9,921.15 rows=1,761 width=8) (actual time=5.567..10.023 rows=22,623 loops=1)

  • 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=925
8. 0.045 5.470 ↓ 0.0 0 1

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

9. 0.962 0.962 ↑ 1.6 22,623 1

Bitmap Index Scan on survey_sentemployeegroup_category_id (cost=0.00..1,009.33 rows=37,312 width=0) (actual time=0.962..0.962 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. 4.463 4.463 ↓ 1.0 124,544 1

Bitmap Index Scan on survey_sentemployeegroup_instance_id (cost=0.00..2,573.86 rows=123,695 width=0) (actual time=4.463..4.463 rows=124,544 loops=1)

  • Index Cond: (instance_id = ANY ('{10288,10131,9995,9938,9828}'::integer[]))
11. 7,088.562 7,088.562 ↑ 1.0 1 3,544,281

Index Scan using survey_surveytaker_pkey on survey_surveytaker (cost=0.43..0.87 rows=1 width=5) (actual time=0.002..0.002 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.490 ms
Execution time : 11,167.138 ms