explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kIT8 : Optimization for: Optimization for: plan #EYye; plan #ycd5

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 101.938 548.743 ↓ 1.0 2,229 1

GroupAggregate (cost=26,219.47..26,976.68 rows=2,228 width=64) (actual time=381.345..548.743 rows=2,229 loops=1)

  • Group Key: r.tenant_id, r.asset_id
2. 231.954 446.805 ↓ 7.1 516,318 1

Sort (cost=26,219.47..26,401.81 rows=72,936 width=48) (actual time=381.247..446.805 rows=516,318 loops=1)

  • Sort Key: r.asset_id
  • Sort Method: external merge Disk: 29360kB
3. 127.449 214.851 ↓ 7.1 516,318 1

Hash Join (cost=624.72..18,081.31 rows=72,936 width=48) (actual time=1.858..214.851 rows=516,318 loops=1)

  • Hash Cond: (r.access_id = aa.access_id)
4. 85.605 85.605 ↑ 1.0 571,371 1

Seq Scan on security_policy_risk r (cost=0.00..15,956.40 rows=571,392 width=48) (actual time=0.010..85.605 rows=571,371 loops=1)

  • Filter: (tenant_id = '7b26e0d9-d493-30c1-ac75-38d68d70538d'::uuid)
5. 0.583 1.797 ↑ 1.0 2,763 1

Hash (cost=590.18..590.18 rows=2,763 width=32) (actual time=1.797..1.797 rows=2,763 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 205kB
6. 0.939 1.214 ↑ 1.0 2,763 1

Bitmap Heap Scan on access_application aa (cost=316.73..590.18 rows=2,763 width=32) (actual time=0.304..1.214 rows=2,763 loops=1)

  • Recheck Cond: ((tenant_id = '7b26e0d9-d493-30c1-ac75-38d68d70538d'::uuid) AND (application_id = '8a8bb7cd-343a-32ad-99b7-d762030857a2'::uuid))
  • Heap Blocks: exact=148
7. 0.275 0.275 ↑ 1.0 2,763 1

Bitmap Index Scan on idx_access_application_application (cost=0.00..316.04 rows=2,763 width=0) (actual time=0.275..0.275 rows=2,763 loops=1)

  • Index Cond: ((tenant_id = '7b26e0d9-d493-30c1-ac75-38d68d70538d'::uuid) AND (application_id = '8a8bb7cd-343a-32ad-99b7-d762030857a2'::uuid))
Planning time : 0.711 ms
Execution time : 556.208 ms