explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bANk

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,038.262 ↑ 1.0 1 1

Finalize Aggregate (cost=25,056.24..25,056.25 rows=1 width=8) (actual time=1,038.262..1,038.262 rows=1 loops=1)

2. 180.354 1,195.760 ↑ 2.0 1 1

Gather (cost=25,056.02..25,056.23 rows=2 width=8) (actual time=1,038.256..1,195.760 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 253.653 1,015.406 ↑ 1.0 1 1

Partial Aggregate (cost=24,056.02..24,056.03 rows=1 width=8) (actual time=1,015.406..1,015.406 rows=1 loops=1)

4. 336.429 761.753 ↓ 2.4 1,038,518 1

Merge Anti Join (cost=48.07..22,975.28 rows=432,298 width=0) (actual time=4.080..761.753 rows=1,038,518 loops=1)

  • Merge Cond: (contacts.id = contacts_importance_1.contact_id)
  • Join Filter: (contacts_importance_1.company_id = contacts.company_id)
5. 422.626 422.626 ↓ 2.4 1,039,492 1

Parallel Index Only Scan using contacts_pkey on contacts (cost=0.43..21,845.97 rows=432,330 width=26) (actual time=1.679..422.626 rows=1,039,492 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 377
6. 1.299 2.698 ↓ 11.1 974 1

Sort (cost=47.65..47.87 rows=88 width=26) (actual time=2.396..2.698 rows=974 loops=1)

  • Sort Key: contacts_importance_1.contact_id
  • Sort Method: quicksort Memory: 101kB
7. 1.399 1.399 ↓ 11.1 974 1

Index Scan using ix_company_id_user_id on contacts_importance contacts_importance_1 (cost=0.42..44.81 rows=88 width=26) (actual time=0.049..1.399 rows=974 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (user_id = '\x4c21187154397f270a000001'::bytea))
Planning time : 19.182 ms
Execution time : 1,196.164 ms