explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m94dA

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

Finalize Aggregate (cost=30,481.15..30,481.16 rows=1 width=8) (actual time=122,430.226..122,430.227 rows=1 loops=1)

2. 5.318 122,433.147 ↑ 2.0 1 1

Gather (cost=30,480.94..30,481.15 rows=2 width=8) (actual time=122,430.221..122,433.147 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 279.938 122,427.829 ↑ 1.0 1 1

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

4. 882.529 122,147.891 ↓ 2.4 1,042,760 1

Hash Anti Join (cost=54.16..28,392.77 rows=435,269 width=0) (actual time=996.952..122,147.891 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. 120,296.661 120,296.661 ↓ 2.4 1,043,735 1

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

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

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

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

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