explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kLAT

Settings
# exclusive inclusive rows x rows loops node
1. 236.977 3,248.174 ↓ 5,664.5 22,658 1

GroupAggregate (cost=212,781.66..212,782.02 rows=4 width=28) (actual time=2,803.777..3,248.174 rows=22,658 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: 650
2. 959.873 3,011.197 ↓ 190,651.5 2,097,166 1

Sort (cost=212,781.66..212,781.69 rows=11 width=9) (actual time=2,801.253..3,011.197 rows=2,097,166 loops=1)

  • Sort Key: survey_sentemployeegroup.original_id
  • Sort Method: external merge Disk: 39,000kB
3. 511.548 2,051.324 ↓ 190,651.5 2,097,166 1

Hash Join (cost=21,424.57..212,781.47 rows=11 width=9) (actual time=101.151..2,051.324 rows=2,097,166 loops=1)

  • Hash Cond: (survey_sentemployeegroup_takers.sentemployeegroup_id = survey_sentemployeegroup.id)
4. 368.267 1,499.756 ↓ 25.7 2,633,350 1

Nested Loop (cost=5,782.98..196,871.32 rows=102,311 width=9) (actual time=61.106..1,499.756 rows=2,633,350 loops=1)

5. 32.178 132.069 ↓ 199.5 66,628 1

Hash Join (cost=5,782.41..132,417.90 rows=334 width=9) (actual time=61.065..132.069 rows=66,628 loops=1)

  • Hash Cond: (survey_surveytaker.id = u0.surveytaker_id)
6. 39.159 39.159 ↓ 1.3 66,628 1

Index Scan using survey_surveytaker_instance_id on survey_surveytaker (cost=0.43..126,436.67 rows=52,298 width=5) (actual time=0.028..39.159 rows=66,628 loops=1)

  • Index Cond: (instance_id = ANY ('{25849,25147,23929}'::integer[]))
  • Filter: (complete OR (NOT skip_when_counting) OR (skip_when_counting IS NULL))
  • Rows Removed by Filter: 452
7. 12.162 60.732 ↓ 1.1 66,628 1

Hash (cost=5,055.50..5,055.50 rows=58,118 width=4) (actual time=60.732..60.732 rows=66,628 loops=1)

  • Buckets: 131,072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 3,367kB
8. 34.365 48.570 ↓ 1.1 66,628 1

HashAggregate (cost=4,474.32..5,055.50 rows=58,118 width=4) (actual time=37.355..48.570 rows=66,628 loops=1)

  • Group Key: u0.surveytaker_id
9. 14.205 14.205 ↓ 1.1 66,628 1

Index Only Scan using survey_sentemployeeg_sentemployeegroup_id_4c60698edfdf70f4_uniq on survey_sentemployeegroup_takers u0 (cost=0.57..4,319.41 rows=61,964 width=4) (actual time=0.041..14.205 rows=66,628 loops=1)

  • Index Cond: (sentemployeegroup_id = ANY ('{36114328,44099713,42159591}'::integer[]))
  • Heap Fetches: 0
10. 999.420 999.420 ↑ 7.7 40 66,628

Index Scan using survey_sentemployeegroup_takers_surveytaker_id on survey_sentemployeegroup_takers (cost=0.57..189.91 rows=306 width=8) (actual time=0.005..0.015 rows=40 loops=66,628)

  • Index Cond: (surveytaker_id = survey_surveytaker.id)
11. 9.177 40.020 ↓ 32.8 52,598 1

Hash (cost=15,621.56..15,621.56 rows=1,602 width=8) (actual time=40.020..40.020 rows=52,598 loops=1)

  • Buckets: 65,536 (originally 2048) Batches: 1 (originally 1) Memory Usage: 2,567kB
12. 17.015 30.843 ↓ 32.8 52,598 1

Bitmap Heap Scan on survey_sentemployeegroup (cost=9,231.20..15,621.56 rows=1,602 width=8) (actual time=14.120..30.843 rows=52,598 loops=1)

  • Recheck Cond: ((instance_id = ANY ('{25849,25147,23929}'::integer[])) AND (category_id = ANY ('{126815,126816,126817,126818,126819,126820,126821,126822,126823,126824,126825,126826,126827,126828,126829,126830,126831,126832,126833,126834,126835,126836,126837,126838,126839,126840,126841,126842,126843,126844,126845,126846,126847,126848,126849,126850,126851,126852,126853,126854,142149,142148,142147,142146,142145,142144,142143,142142,142141,142140,142139,142138,142137,142136,142135,142134,142133,142132,142131,142130,142129,142128,142127,142126,142125,142124,142123,142122,142121,142120,142119,142118,142117,142116,142043,141991,141990,141989,141988,141987,141986,141985,141984,149695,149694,149693,149692,149691,149690,149689,149688,149687,149686,149685,149684,149683,149682,149681,149680,149679,149678,149677,149676,149675,149674,149673,149672,149671,149670,149669,149668,149667,149666,149665,149664,149663,149659,149658,149657,149656,149655,149654,149653,149652,149651}'::integer[])))
  • Filter: (original_id IS NOT NULL)
  • Heap Blocks: exact=1,838
13. 0.325 13.828 ↓ 0.0 0 1

BitmapAnd (cost=9,231.20..9,231.20 rows=1,602 width=0) (actual time=13.828..13.828 rows=0 loops=1)

14. 9.585 9.585 ↓ 1.1 127,436 1

Bitmap Index Scan on survey_sentemployeegroup_instance_id (cost=0.00..3,056.21 rows=113,936 width=0) (actual time=9.585..9.585 rows=127,436 loops=1)

  • Index Cond: (instance_id = ANY ('{25849,25147,23929}'::integer[]))
15. 3.918 3.918 ↑ 4.1 52,598 1

Bitmap Index Scan on survey_sentemployeegroup_category_id (cost=0.00..6,173.94 rows=218,071 width=0) (actual time=3.917..3.918 rows=52,598 loops=1)

  • Index Cond: (category_id = ANY ('{126815,126816,126817,126818,126819,126820,126821,126822,126823,126824,126825,126826,126827,126828,126829,126830,126831,126832,126833,126834,126835,126836,126837,126838,126839,126840,126841,126842,126843,126844,126845,126846,126847,126848,126849,126850,126851,126852,126853,126854,142149,142148,142147,142146,142145,142144,142143,142142,142141,142140,142139,142138,142137,142136,142135,142134,142133,142132,142131,142130,142129,142128,142127,142126,142125,142124,142123,142122,142121,142120,142119,142118,142117,142116,142043,141991,141990,141989,141988,141987,141986,141985,141984,149695,149694,149693,149692,149691,149690,149689,149688,149687,149686,149685,149684,149683,149682,149681,149680,149679,149678,149677,149676,149675,149674,149673,149672,149671,149670,149669,149668,149667,149666,149665,149664,149663,149659,149658,149657,149656,149655,149654,149653,149652,149651}'::integer[]))
Planning time : 1.393 ms
Execution time : 3,256.803 ms