explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n7QD

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,559.225 ↑ 1.0 1 1

Finalize Aggregate (cost=184,031.82..184,031.83 rows=1 width=8) (actual time=3,559.225..3,559.225 rows=1 loops=1)

2. 262.017 3,699.065 ↓ 1.5 3 1

Gather (cost=184,031.61..184,031.82 rows=2 width=8) (actual time=3,558.001..3,699.065 rows=3 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 41.499 3,437.048 ↑ 1.0 1 3 / 3

Partial Aggregate (cost=183,031.61..183,031.62 rows=1 width=8) (actual time=3,437.048..3,437.048 rows=1 loops=3)

4. 307.176 3,395.549 ↓ 2.2 312,806 3 / 3

Merge Join (cost=0.98..182,676.03 rows=142,231 width=0) (actual time=108.954..3,395.549 rows=312,806 loops=3)

  • Merge Cond: (contacts.id = contacts_tags_associations.contact_id)
5. 85.834 85.834 ↑ 1.3 347,859 3 / 3

Parallel Index Only Scan using ix_company_id_id on contacts (cost=0.43..22,540.41 rows=435,266 width=26) (actual time=0.185..85.834 rows=347,859 loops=3)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 2,534
6. 134.853 3,002.539 ↓ 2.2 938,410 3 / 3

Materialize (cost=0.56..156,558.32 rows=426,728 width=26) (actual time=0.231..3,002.539 rows=938,410 loops=3)

7. 671.054 2,867.686 ↓ 2.2 938,410 3 / 3

Unique (cost=0.56..151,224.22 rows=426,728 width=26) (actual time=0.218..2,867.686 rows=938,410 loops=3)

8. 2,196.632 2,196.632 ↓ 1.0 4,260,717 3 / 3

Index Only Scan using contacts_tags_associations_pkey on contacts_tags_associations (cost=0.56..140,575.24 rows=4,259,594 width=26) (actual time=0.216..2,196.632 rows=4,260,717 loops=3)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (contact_id IS NOT NULL))
  • Heap Fetches: 0
Planning time : 0.249 ms
Execution time : 3,699.171 ms