explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sDS2

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 37,807.375 ↑ 1.0 1 1

Finalize Aggregate (cost=207,138.22..207,138.23 rows=1 width=8) (actual time=37,807.375..37,807.375 rows=1 loops=1)

2. 38.359 37,842.535 ↑ 2.0 1 1

Gather (cost=207,138.00..207,138.21 rows=2 width=8) (actual time=37,807.369..37,842.535 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 3,837.729 37,804.176 ↑ 1.0 1 1

Partial Aggregate (cost=206,138.00..206,138.01 rows=1 width=8) (actual time=37,804.176..37,804.176 rows=1 loops=1)

4. 5,638.280 33,966.447 ↓ 3.0 4,260,676 1

Merge Join (cost=16.58..202,594.25 rows=1,417,502 width=0) (actual time=0.107..33,966.447 rows=4,260,676 loops=1)

  • Merge Cond: (contacts_tags_associations_1.contact_id = contacts.id)
5. 27,079.008 27,079.008 ↓ 2.4 4,260,676 1

Parallel Index Only Scan using contacts_tags_associations_pkey on contacts_tags_associations contacts_tags_associations_1 (cost=0.56..152,888.47 rows=1,775,354 width=26) (actual time=0.053..27,079.008 rows=4,260,676 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (contact_id IS NOT NULL))
  • Heap Fetches: 4,260,676
6. 1,249.159 1,249.159 ↓ 1.0 1,043,574 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.049..1,249.159 rows=1,043,574 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 70
Planning time : 0.645 ms
Execution time : 37,842.681 ms