explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R4Mw

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

Finalize Aggregate (cost=30,481.15..30,481.16 rows=1 width=8) (actual time=1,882.734..1,882.735 rows=1 loops=1)

2. 3.089 1,883.507 ↑ 2.0 1 1

Gather (cost=30,480.94..30,481.15 rows=2 width=8) (actual time=1,882.727..1,883.507 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 250.723 1,880.418 ↑ 1.0 1 1

Partial Aggregate (cost=29,480.94..29,480.95 rows=1 width=8) (actual time=1,880.418..1,880.418 rows=1 loops=1)

4. 513.242 1,629.695 ↓ 2.4 1,042,760 1

Hash Anti Join (cost=54.16..28,392.77 rows=435,269 width=0) (actual time=1.652..1,629.695 rows=1,042,760 loops=1)

  • Hash Cond: ((contacts.company_id = contacts_importance_1.company_id) AND (contacts.id = contacts_importance_1.contact_id))
5. 1,114.821 1,114.821 ↓ 2.4 1,043,735 1

Parallel Seq Scan on contacts (cost=0.00..21,698.95 rows=435,307 width=26) (actual time=0.008..1,114.821 rows=1,043,735 loops=1)

  • Filter: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Rows Removed by Filter: 141,114
6. 0.428 1.632 ↓ 9.4 975 1

Hash (cost=52.60..52.60 rows=104 width=26) (actual time=1.632..1.632 rows=975 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 64kB
7. 1.204 1.204 ↓ 9.4 975 1

Index Scan using ix_company_id_user_id on contacts_importance contacts_importance_1 (cost=0.42..52.60 rows=104 width=26) (actual time=0.084..1.204 rows=975 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (user_id = '\x4c21187154397f270a000001'::bytea) AND (is_important IS NOT NULL))
Planning time : 0.437 ms
Execution time : 1,883.654 ms