explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FM1G

Settings
# exclusive inclusive rows x rows loops node
1. 439.367 24,709.576 ↑ 1.0 1 1

Aggregate (cost=182,323.63..182,323.64 rows=1 width=8) (actual time=24,709.576..24,709.576 rows=1 loops=1)

2. 6,607.833 24,270.209 ↓ 2.8 938,419 1

Hash Join (cost=158,857.25..181,471.93 rows=340,677 width=0) (actual time=16,411.184..24,270.209 rows=938,419 loops=1)

  • Hash Cond: (contacts_tags_associations.contact_id = contacts.id)
3. 10,055.543 13,918.108 ↓ 2.2 938,419 1

HashAggregate (cost=110,198.55..114,465.37 rows=426,682 width=26) (actual time=12,640.758..13,918.108 rows=938,419 loops=1)

  • Group Key: contacts_tags_associations.company_id, contacts_tags_associations.contact_id
4. 3,862.565 3,862.565 ↑ 1.0 4,260,676 1

Seq Scan on contacts_tags_associations (cost=0.00..88,894.30 rows=4,260,850 width=26) (actual time=1.532..3,862.565 rows=4,260,676 loops=1)

  • Filter: ((contact_id IS NOT NULL) AND (company_id = '\x4c2118ad54397f271b000000'::bytea))
  • Rows Removed by Filter: 6,188
5. 2,768.145 3,744.268 ↓ 1.0 1,043,578 1

Hash (cost=28,499.65..28,499.65 rows=1,042,564 width=26) (actual time=3,744.268..3,744.268 rows=1,043,578 loops=1)

  • Buckets: 524,288 Batches: 4 Memory Usage: 18,847kB
6. 976.123 976.123 ↓ 1.0 1,043,578 1

Index Only Scan using ix_company_id_id on contacts (cost=0.43..28,499.65 rows=1,042,564 width=26) (actual time=0.222..976.123 rows=1,043,578 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 70
Planning time : 0.561 ms
Execution time : 25,050.911 ms