explain.depesz.com

PostgreSQL's explain analyze made readable

Result: J1vk

Settings
# exclusive inclusive rows x rows loops node
1. 75.171 5,059.457 ↑ 1.0 1 1

Aggregate (cost=182,528.12..182,528.13 rows=1 width=8) (actual time=5,059.457..5,059.457 rows=1 loops=1)

2. 1,087.902 4,984.286 ↓ 2.7 938,419 1

Hash Join (cost=159,042.01..181,674.74 rows=341,354 width=0) (actual time=3,629.677..4,984.286 rows=938,419 loops=1)

  • Hash Cond: (contacts_tags_associations.contact_id = contacts.id)
3. 2,470.139 3,399.299 ↓ 2.2 938,419 1

HashAggregate (cost=110,207.91..114,475.19 rows=426,728 width=26) (actual time=3,119.704..3,399.299 rows=938,419 loops=1)

  • Group Key: contacts_tags_associations.company_id, contacts_tags_associations.contact_id
4. 929.160 929.160 ↓ 1.0 4,260,732 1

Seq Scan on contacts_tags_associations (cost=0.00..88,909.94 rows=4,259,594 width=26) (actual time=0.538..929.160 rows=4,260,732 loops=1)

  • Filter: ((contact_id IS NOT NULL) AND (company_id = '\x4c2118ad54397f271b000000'::bytea))
  • Rows Removed by Filter: 6,543
5. 301.028 497.085 ↑ 1.0 1,043,578 1

Hash (cost=28,634.13..28,634.13 rows=1,044,638 width=26) (actual time=497.085..497.085 rows=1,043,578 loops=1)

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

Index Only Scan using ix_company_id_id on contacts (cost=0.43..28,634.13 rows=1,044,638 width=26) (actual time=0.026..196.057 rows=1,043,578 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 5,260
Planning time : 0.369 ms
Execution time : 5,102.292 ms