explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VBJp

Settings
# exclusive inclusive rows x rows loops node
1. 102.732 5,959.510 ↑ 1.0 1 1

Aggregate (cost=24,812.85..24,812.86 rows=1 width=8) (actual time=5,959.509..5,959.510 rows=1 loops=1)

2. 359.056 5,856.778 ↓ 1,043,455.0 1,043,455 1

Gather (cost=1,173.25..24,812.85 rows=1 width=0) (actual time=3.285..5,856.778 rows=1,043,455 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 43.524 5,497.722 ↓ 347,818.0 347,818 3 / 3

Nested Loop Left Join (cost=173.25..23,812.75 rows=1 width=0) (actual time=1.068..5,497.722 rows=347,818 loops=3)

4. 124.048 236.923 ↓ 347,818.0 347,818 3 / 3

Merge Left Join (cost=170.18..23,809.36 rows=1 width=26) (actual time=0.677..236.923 rows=347,818 loops=3)

  • Merge Cond: (contacts.id = contacts_tags_associations_1.contact_id)
  • Join Filter: (contacts_tags_associations_1.company_id = contacts.company_id)
  • Filter: (contacts_tags_1.tag IS NULL)
  • Rows Removed by Filter: 41
5. 112.335 112.335 ↑ 1.3 347,859 3 / 3

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

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Heap Fetches: 2,451
6. 0.164 0.540 ↑ 8.8 123 3 / 3

Sort (cost=169.75..172.46 rows=1,084 width=47) (actual time=0.528..0.540 rows=123 loops=3)

  • Sort Key: contacts_tags_associations_1.contact_id
  • Sort Method: quicksort Memory: 34kB
7. 0.068 0.376 ↑ 8.8 123 3 / 3

Nested Loop (cost=0.84..115.11 rows=1,084 width=47) (actual time=0.331..0.376 rows=123 loops=3)

8. 0.137 0.137 ↑ 1.0 1 3 / 3

Index Only Scan using ix_contacts_tags_company_id_tag_tag_id on contacts_tags contacts_tags_1 (cost=0.28..2.50 rows=1 width=47) (actual time=0.137..0.137 rows=1 loops=3)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (tag = '00_bulk_131'::text))
  • Heap Fetches: 1
9. 0.171 0.171 ↑ 22.3 123 3 / 3

Index Only Scan using ix_contacts_tags_associations_company_id_tag_id_contact_id on contacts_tags_associations contacts_tags_associations_1 (cost=0.56..85.16 rows=2,745 width=39) (actual time=0.141..0.171 rows=123 loops=3)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (tag_id = contacts_tags_1.id))
  • Heap Fetches: 0
10. 695.599 5,217.275 ↓ 0.0 0 1,043,455 / 3

Hash Join (cost=3.07..3.37 rows=1 width=26) (actual time=0.015..0.015 rows=0 loops=1,043,455)

  • Hash Cond: (contacts_tags_associations.tag_id = contacts_tags.id)
11. 4,521.638 4,521.638 ↑ 2.5 4 1,043,455 / 3

Index Only Scan using contacts_tags_associations_pkey on contacts_tags_associations (cost=0.56..0.84 rows=10 width=39) (actual time=0.008..0.013 rows=4 loops=1,043,455)

  • Index Cond: ((company_id = contacts.company_id) AND (company_id = '\x4c2118ad54397f271b000000'::bytea) AND (contact_id = contacts.id))
  • Heap Fetches: 0
12. 0.014 0.038 ↑ 1.0 1 3 / 3

Hash (cost=2.50..2.50 rows=1 width=26) (actual time=0.038..0.038 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.024 0.024 ↑ 1.0 1 3 / 3

Index Only Scan using ix_contacts_tags_company_id_tag_tag_id on contacts_tags (cost=0.28..2.50 rows=1 width=26) (actual time=0.023..0.024 rows=1 loops=3)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (tag = 'import1502910941'::text))
  • Heap Fetches: 1
Planning time : 0.672 ms
Execution time : 6,009.344 ms