explain.depesz.com

PostgreSQL's explain analyze made readable

Result: H471

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.700 ↑ 1.0 1 1

Limit (cost=3.65..6.39 rows=1 width=972) (actual time=0.698..0.700 rows=1 loops=1)

2. 0.023 0.696 ↑ 171,885.0 1 1

Nested Loop Left Join (cost=3.65..471,495.12 rows=171,885 width=972) (actual time=0.695..0.696 rows=1 loops=1)

3. 0.004 0.639 ↑ 57,295.0 1 1

Nested Loop Left Join (cost=0.73..291,732.06 rows=57,295 width=1,054) (actual time=0.638..0.639 rows=1 loops=1)

4. 0.005 0.421 ↑ 57,295.0 1 1

Nested Loop (cost=0.29..23,423.61 rows=57,295 width=516) (actual time=0.420..0.421 rows=1 loops=1)

5. 0.016 0.016 ↑ 55,222.0 1 1

Seq Scan on companies (cost=0.00..3,598.22 rows=55,222 width=191) (actual time=0.015..0.016 rows=1 loops=1)

6. 0.400 0.400 ↑ 1.0 1 1

Index Scan using companies_data_company_id_idx on companies_data (cost=0.29..0.35 rows=1 width=329) (actual time=0.400..0.400 rows=1 loops=1)

  • Index Cond: (company_id = companies.company_id)
7. 0.003 0.214 ↓ 0.0 0 1

Limit (cost=0.44..4.66 rows=1 width=538) (actual time=0.213..0.214 rows=0 loops=1)

8. 0.105 0.211 ↓ 0.0 0 1

Nested Loop (cost=0.44..13.11 rows=3 width=538) (actual time=0.210..0.211 rows=0 loops=1)

  • Join Filter: (comp_address.countryid = utl_countries.countryid)
9. 0.062 0.062 ↑ 1.0 44 1

Seq Scan on utl_countries (cost=0.00..1.44 rows=44 width=520) (actual time=0.014..0.062 rows=44 loops=1)

10. 0.035 0.044 ↓ 0.0 0 44

Materialize (cost=0.44..9.70 rows=3 width=26) (actual time=0.001..0.001 rows=0 loops=44)

11. 0.002 0.009 ↓ 0.0 0 1

Nested Loop (cost=0.44..9.69 rows=3 width=26) (actual time=0.008..0.009 rows=0 loops=1)

12. 0.007 0.007 ↓ 0.0 0 1

Index Scan using comp_address_compid_iswithdrawn_idx on comp_address (cost=0.29..3.68 rows=3 width=8) (actual time=0.006..0.007 rows=0 loops=1)

  • Index Cond: ((compid = companies.company_id) AND (iswithdrawn = false))
  • Filter: (NOT iswithdrawn)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using utl_cities_pkey on utl_cities (cost=0.15..2.00 rows=1 width=26) (never executed)

  • Index Cond: (cityid = comp_address.cityid)
14. 0.004 0.034 ↓ 0.0 0 1

HashAggregate (cost=2.92..2.98 rows=3 width=44) (actual time=0.033..0.034 rows=0 loops=1)

  • Group Key: sum((count(*))) OVER (?)
15. 0.002 0.030 ↓ 0.0 0 1

WindowAgg (cost=2.74..2.81 rows=3 width=44) (actual time=0.029..0.030 rows=0 loops=1)

16. 0.003 0.028 ↓ 0.0 0 1

HashAggregate (cost=2.74..2.77 rows=3 width=12) (actual time=0.026..0.028 rows=0 loops=1)

  • Group Key: ratings2.value
17. 0.005 0.025 ↓ 0.0 0 1

Nested Loop (cost=0.41..2.70 rows=5 width=4) (actual time=0.024..0.025 rows=0 loops=1)

18. 0.012 0.012 ↑ 1.0 1 1

Seq Scan on rating_statuss (cost=0.00..1.04 rows=1 width=4) (actual time=0.010..0.012 rows=1 loops=1)

  • Filter: ((rating_status_constant)::text = 'RATE_MARK_SET'::text)
  • Rows Removed by Filter: 2
19. 0.008 0.008 ↓ 0.0 0 1

Index Only Scan using ix_ratings2 on ratings2 (cost=0.41..1.62 rows=5 width=8) (actual time=0.007..0.008 rows=0 loops=1)

  • Index Cond: ((objectcompid = companies.company_id) AND (ratingstatuslid = rating_statuss.rating_status_id))
  • Heap Fetches: 0
Planning time : 0.866 ms
Execution time : 0.819 ms