explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F3Gz

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 200,501.903 ↓ 7.0 7 1

Sort (cost=82,257.57..82,257.58 rows=1 width=3,280) (actual time=200,501.896..200,501.903 rows=7 loops=1)

  • Sort Key: company_contractor_positions.cps_name
  • Sort Method: quicksort Memory: 28kB
2. 0.024 200,501.869 ↓ 7.0 7 1

Group (cost=82,257.55..82,257.56 rows=1 width=3,280) (actual time=200,501.844..200,501.869 rows=7 loops=1)

  • Group Key: company_contractor_positions.cps_id, company_contractors.cc_id, professions.prof_id, company_contractor_join.ccj_id
3. 0.060 200,501.845 ↓ 7.0 7 1

Sort (cost=82,257.55..82,257.55 rows=1 width=3,272) (actual time=200,501.838..200,501.845 rows=7 loops=1)

  • Sort Key: company_contractor_positions.cps_id, company_contractors.cc_id, professions.prof_id, company_contractor_join.ccj_id
  • Sort Method: quicksort Memory: 28kB
4. 17.946 200,501.785 ↓ 7.0 7 1

Nested Loop Left Join (cost=1,002.52..82,257.54 rows=1 width=3,272) (actual time=10,803.893..200,501.785 rows=7 loops=1)

  • Join Filter: ((professions.prof_code)::text = (company_contractor_positions.cps_profession_code)::text)
  • Rows Removed by Join Filter: 19712
5. 21.434 200,467.704 ↓ 7.0 7 1

Nested Loop Left Join (cost=1,002.52..82,074.24 rows=1 width=2,748) (actual time=10,800.357..200,467.704 rows=7 loops=1)

  • Join Filter: ((company_contractor_positions.cps_entity_type)::text = 'contractors'::text)
  • Rows Removed by Join Filter: 2
  • Filter: ((((company_contractor_positions.cps_entity_type)::text = 'contractors'::text) AND (company_contractor_join.ccj_company_fkey = 1534)) OR (((company_contractor_positions.cps_entity_type)::text = 'company'::text) AND (compan (...)
  • Rows Removed by Filter: 1718
6. 0.000 7.054 ↓ 1,272.0 1,272 1

Gather (cost=1,000.00..79,990.67 rows=1 width=2,216) (actual time=0.467..7.054 rows=1,272 loops=1)

  • Workers Planned: 4
  • Workers Launched: 3
7. 89.389 89.389 ↓ 318.0 318 4 / 4

Parallel Seq Scan on company_contractor_positions (cost=0.00..78,990.57 rows=1 width=2,216) (actual time=0.069..89.389 rows=318 loops=4)

  • Filter: ((cps_deleted IS FALSE) AND ((cps_name)::text ~~* '%Operator%'::text) AND (((cps_entity_type)::text = 'contractors'::text) OR (((cps_entity_type)::text = 'company'::text) AND (cps_entity_fkey = 1534))))
  • Rows Removed by Filter: 59289
8. 104,932.130 200,439.216 ↑ 1.0 1 1,272

Hash Right Join (cost=2.52..2,083.55 rows=1 width=540) (actual time=44.464..157.578 rows=1 loops=1,272)

  • Hash Cond: (company_contractor_join.ccj_contractor_fkey = company_contractors.cc_id)
9. 95,458.750 95,458.750 ↑ 1.0 95,123 1,250

Seq Scan on company_contractor_join (cost=0.00..1,831.30 rows=95,130 width=24) (actual time=0.004..76.367 rows=95,123 loops=1,250)

10. 8.904 48.336 ↑ 1.0 1 1,272

Hash (cost=2.51..2.51 rows=1 width=524) (actual time=0.038..0.038 rows=1 loops=1,272)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 39.432 39.432 ↑ 1.0 1 1,272

Index Scan using company_contractors_cc_id_pkey on company_contractors (cost=0.29..2.51 rows=1 width=524) (actual time=0.029..0.031 rows=1 loops=1,272)

  • Index Cond: (company_contractor_positions.cps_entity_fkey = cc_id)
  • Filter: (cc_deleted IS FALSE)
  • Rows Removed by Filter: 0
12. 16.135 16.135 ↑ 1.7 2,817 7

Seq Scan on professions (cost=0.00..124.80 rows=4,680 width=1,040) (actual time=0.042..2.305 rows=2,817 loops=7)

Planning time : 0.377 ms
Execution time : 200,502.144 ms