explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1RtC

Settings
# exclusive inclusive rows x rows loops node
1. 92.799 4,782.842 ↑ 1.0 1 1

Aggregate (cost=1,059,589.39..1,059,589.40 rows=1 width=8) (actual time=4,782.842..4,782.842 rows=1 loops=1)

2. 341.805 4,690.043 ↓ 9.3 938,513 1

Merge Join (cost=1.13..1,059,336.37 rows=101,208 width=0) (actual time=0.060..4,690.043 rows=938,513 loops=1)

  • Merge Cond: (contacts_tags_associations.contact_id = contacts.id)
3. 423.648 4,044.669 ↑ 3.7 938,513 1

Unique (cost=0.57..965,135.74 rows=3,466,021 width=26) (actual time=0.037..4,044.669 rows=938,513 loops=1)

4. 3,621.021 3,621.021 ↓ 1.0 4,263,946 1

Index Only Scan using contacts_tags_associations_pkey on contacts_tags_associations (cost=0.57..954,660.85 rows=4,189,959 width=26) (actual time=0.036..3,621.021 rows=4,263,946 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (contact_id IS NOT NULL))
  • Heap Fetches: 4,263,946
5. 303.569 303.569 ↑ 1.4 1,043,747 1

Index Only Scan using contacts_pkey on contacts (cost=0.56..46,083.68 rows=1,511,839 width=26) (actual time=0.020..303.569 rows=1,043,747 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 65,547
Planning time : 0.269 ms
Execution time : 4,782.893 ms