explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RqC8

Settings
# exclusive inclusive rows x rows loops node
1. 0.087 3.872 ↓ 1,000.0 1,000 1

Limit (cost=2,489.57..26,004.57 rows=1 width=17) (actual time=2.502..3.872 rows=1,000 loops=1)

2. 2.888 3.785 ↓ 1,000.0 1,000 1

Gather (cost=2,489.57..26,004.57 rows=1 width=17) (actual time=2.501..3.785 rows=1,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 0.245 0.897 ↓ 1,000.0 1,000 1

Merge Left Join (cost=1,489.57..25,004.47 rows=1 width=17) (actual time=0.300..0.897 rows=1,000 loops=1)

  • Merge Cond: (contacts.id = contacts_tags_associations.contact_id)
  • Join Filter: (contacts_tags_associations.company_id = contacts.company_id)
  • Filter: (contacts_tags.tag IS NULL)
4. 0.391 0.391 ↑ 434.4 1,000 1

Parallel Index Only Scan using ix_company_id_id on contacts (cost=0.43..22,419.13 rows=434,402 width=26) (actual time=0.036..0.391 rows=1,000 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 2
5. 0.083 0.261 ↑ 1,112.0 1 1

Sort (cost=1,489.15..1,491.93 rows=1,112 width=47) (actual time=0.261..0.261 rows=1 loops=1)

  • Sort Key: contacts_tags_associations.contact_id
  • Sort Method: quicksort Memory: 34kB
6. 0.029 0.178 ↑ 9.0 123 1

Nested Loop (cost=0.84..1,432.89 rows=1,112 width=47) (actual time=0.087..0.178 rows=123 loops=1)

7. 0.029 0.029 ↑ 1.0 1 1

Index Scan using ix_contacts_tags_company_id_tag on contacts_tags (cost=0.28..2.50 rows=1 width=47) (actual time=0.028..0.029 rows=1 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (tag = '00_bulk_131'::text))
8. 0.120 0.120 ↑ 22.4 123 1

Index Only Scan using ix_contacts_tags_associations_company_id_tag_id_contact_id on contacts_tags_associations (cost=0.56..1,402.83 rows=2,756 width=39) (actual time=0.050..0.120 rows=123 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (tag_id = contacts_tags.id))
  • Heap Fetches: 123
Planning time : 1.199 ms
Execution time : 4.083 ms