explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aYtC

Settings
# exclusive inclusive rows x rows loops node
1. 1.150 209.825 ↓ 1,446.0 1,446 1

Nested Loop Anti Join (cost=13,673.72..15,456.01 rows=1 width=8) (actual time=63.301..209.825 rows=1,446 loops=1)

  • Buffers: shared hit=84,841
2. 24.497 64.075 ↓ 1,446.0 1,446 1

Hash Right Join (cost=13,673.44..15,301.52 rows=1 width=16) (actual time=63.159..64.075 rows=1,446 loops=1)

  • Hash Cond: (ad.user_id = ku.user_id)
  • Filter: ((ad.deleted IS NULL) OR (ad.deleted = 0))
  • Rows Removed by Filter: 13,651
  • Buffers: shared hit=8,163
3. 17.922 17.922 ↓ 1.0 77,371 1

Seq Scan on agent_details ad (cost=0.00..1,328.52 rows=76,852 width=10) (actual time=0.006..17.922 rows=77,371 loops=1)

  • Buffers: shared hit=560
4. 4.984 21.656 ↓ 2.5 15,097 1

Hash (cost=13,596.69..13,596.69 rows=6,140 width=16) (actual time=21.656..21.656 rows=15,097 loops=1)

  • Buckets: 16,384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 836kB
  • Buffers: shared hit=7,603
5. 14.715 16.672 ↓ 2.5 15,097 1

Bitmap Heap Scan on konotor_user ku (cost=202.05..13,596.69 rows=6,140 width=16) (actual time=3.110..16.672 rows=15,097 loops=1)

  • Recheck Cond: (((app_id = '231180530985826'::bigint) AND (user_type = 1)) OR ((app_id = '231180530985826'::bigint) AND (user_type = 2)))
  • Heap Blocks: exact=7,523
  • Buffers: shared hit=7,603
6. 0.003 1.957 ↓ 0.0 0 1

BitmapOr (cost=202.05..202.05 rows=6,213 width=0) (actual time=1.957..1.957 rows=0 loops=1)

  • Buffers: shared hit=80
7. 0.008 0.008 ↑ 401.0 1 1

Bitmap Index Scan on konotor_user_app_id_user_type_idx (cost=0.00..16.43 rows=401 width=0) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: ((app_id = '231180530985826'::bigint) AND (user_type = 1))
  • Buffers: shared hit=3
8. 1.946 1.946 ↓ 2.6 15,137 1

Bitmap Index Scan on konotor_user_app_id_user_type_idx (cost=0.00..182.54 rows=5,812 width=0) (actual time=1.946..1.946 rows=15,137 loops=1)

  • Index Cond: ((app_id = '231180530985826'::bigint) AND (user_type = 2))
  • Buffers: shared hit=77
9. 144.600 144.600 ↓ 0.0 0 1,446

Index Only Scan using uk_groupid_userid on group_user gu (cost=0.28..77.38 rows=1 width=16) (actual time=0.100..0.100 rows=0 loops=1,446)

  • Index Cond: (user_id = ku.user_id)
  • Filter: (SubPlan 1)
  • Heap Fetches: 62
  • Buffers: shared hit=76,678
10.          

SubPlan (for Index Only Scan)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using groups_app_id_operating_hours_id_idx on groups g (cost=0.42..58.68 rows=2 width=8) (never executed)

  • Index Cond: (app_id = ku.app_id)
  • Filter: (NOT deleted)
Planning time : 0.417 ms
Execution time : 210.301 ms