explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1NzB

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

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

2. 6.086 2,070.832 ↑ 2.0 1 1

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

  • Workers Planned: 2
  • Workers Launched: 0
3. 322.362 2,064.746 ↑ 1.0 1 1

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

4. 958.243 1,742.384 ↓ 2.4 1,042,760 1

Hash Anti Join (cost=54.16..28,392.77 rows=435,269 width=0) (actual time=2.997..1,742.384 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. 781.182 781.182 ↓ 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.009..781.182 rows=1,043,735 loops=1)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 64kB
7. 2.283 2.283 ↓ 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.101..2.283 rows=975 loops=1)

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