explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6fC7

Settings
# exclusive inclusive rows x rows loops node
1. 309.003 37,285.280 ↑ 137.2 6 1

GroupAggregate (cost=2,347,832.52..2,347,846.92 rows=823 width=24) (actual time=37,023.448..37,285.280 rows=6 loops=1)

  • Group Key: organizati0_.segment_uuid
  • Buffers: shared hit=5704091 read=165284 dirtied=1965, temp read=6725 written=6749
2. 445.013 36,976.277 ↓ 840.5 691,692 1

Sort (cost=2,347,832.52..2,347,834.58 rows=823 width=32) (actual time=36,908.592..36,976.277 rows=691,692 loops=1)

  • Sort Key: organizati0_.segment_uuid
  • Sort Method: external merge Disk: 28456kB
  • Buffers: shared hit=5704091 read=165284 dirtied=1965, temp read=5116 written=5135
3. 176.204 36,531.264 ↓ 840.5 691,692 1

Nested Loop (cost=407,147.21..2,347,792.67 rows=823 width=32) (actual time=816.287..36,531.264 rows=691,692 loops=1)

  • Buffers: shared hit=5704091 read=165284 dirtied=1965, temp read=705 written=708
4. 61.068 961.460 ↓ 1.9 221,210 1

Unique (cost=407,146.51..407,740.57 rows=116,560 width=16) (actual time=816.015..961.460 rows=221,210 loops=1)

  • Buffers: shared hit=25517 read=1951, temp read=705 written=708
5. 185.424 900.392 ↓ 1.9 221,210 1

Sort (cost=407,146.51..407,443.54 rows=118,812 width=16) (actual time=816.014..900.392 rows=221,210 loops=1)

  • Sort Key: personcens1_.person_uuid
  • Sort Method: external merge Disk: 5640kB
  • Buffers: shared hit=25517 read=1951, temp read=705 written=708
6. 649.389 714.968 ↓ 1.9 221,210 1

Bitmap Heap Scan on person_census personcens1_ (cost=13,220.62..395,098.16 rows=118,812 width=16) (actual time=68.779..714.968 rows=221,210 loops=1)

  • Recheck Cond: ((organization_uuid = '643280f2-5950-4675-9f61-0ca557dbe088'::uuid) AND ('2020-03-19 15:12:27.332-04'::timestamp with time zone >= effective_start) AND ('2020-03-19 15:12:27.332-04'::timestamp with time zone < effective_end))
  • Heap Blocks: exact=23997
  • Buffers: shared hit=25517 read=1951
7. 65.579 65.579 ↓ 1.9 221,210 1

Bitmap Index Scan on person_census_search_view (cost=0.00..13,190.92 rows=118,812 width=0) (actual time=65.579..65.579 rows=221,210 loops=1)

  • Index Cond: ((organization_uuid = '643280f2-5950-4675-9f61-0ca557dbe088'::uuid) AND ('2020-03-19 15:12:27.332-04'::timestamp with time zone >= effective_start) AND ('2020-03-19 15:12:27.332-04'::timestamp with time zone < effective_end))
  • Buffers: shared hit=3471
8. 35,393.600 35,393.600 ↓ 3.0 3 221,210

Index Scan using "organization_segment_assignment$idx1" on organization_segment_assignment organizati0_ (cost=0.70..16.62 rows=1 width=32) (actual time=0.028..0.160 rows=3 loops=221,210)

  • Index Cond: ((organization_uuid = '643280f2-5950-4675-9f61-0ca557dbe088'::uuid) AND (person_uuid = personcens1_.person_uuid) AND ('2020-03-19 15:12:27.332-04'::timestamp with time zone >= effective_start)AND ('2020-03-19 15:12:27.332-04'::timestamp with time zone < effective_end))
  • Filter: ((assignment_type = ANY ('{ManualInclude,AutomaticInclude}'::text[])) AND (segment_uuid = ANY ('{71ef2914-1bfe-43cd-95f2-c444361b8ca3,4d076fab-331f-4a96-a7a6-ae6278e50cf0,59341f2e-2bc6-4606-802f-4e89675dd81e,be8686a6-88a5-43ac-863a-31937f606b81,63358cf2-841e-41ab-9bcf-990005647168,dbaef52b-e04b-4577-ac0f-0c9e0aa58ae9,d345c4c0-cf40-4484-affc-0b634c6cbb48,59ec35ea-5f38-43bf-bfea-4ad765a575a9,7e8ab5b1-c1f6-48f3-bace-21efd69766cc,d7387947-3f32-4924-bd57-9b0b7cc1a024}'::uuid[])))
  • Rows Removed by Filter: 18
  • Buffers: shared hit=5678574 read=163333 dirtied=1965
Planning time : 7.209 ms
Execution time : 37,291.839 ms