explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q7TM

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 7.406 ↓ 0.0 0 1

Unique (cost=6,405.27..6,405.36 rows=2 width=832) (actual time=7.406..7.406 rows=0 loops=1)

2.          

CTE gtab

3. 0.060 0.060 ↑ 1.0 1 1

Result (cost=0.00..0.26 rows=1 width=32) (actual time=0.060..0.060 rows=1 loops=1)

4.          

CTE homogenized_geoms

5. 0.001 7.321 ↓ 0.0 0 1

Nested Loop Left Join (cost=10.78..6,404.37 rows=1 width=945) (actual time=7.321..7.321 rows=0 loops=1)

6. 0.001 7.320 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.50..6,395.54 rows=1 width=383) (actual time=7.320..7.320 rows=0 loops=1)

  • Join Filter: (e_cte.publisher_organisation_id = lku_orgref.organisation_id)
7. 0.000 7.319 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.50..6,338.94 rows=1 width=365) (actual time=7.319..7.319 rows=0 loops=1)

  • Join Filter: ((e_cte.entity_category)::text = (lku_ec_lang.nsa_code)::text)
8. 0.000 7.319 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.50..6,335.82 rows=1 width=335) (actual time=7.319..7.319 rows=0 loops=1)

  • Join Filter: ((e_cte.entity_category)::text = (lku_ec.nsa_code)::text)
9. 0.023 7.319 ↓ 0.0 0 1

Nested Loop (cost=6.50..6,331.77 rows=1 width=313) (actual time=7.319..7.319 rows=0 loops=1)

  • Join Filter: ((e_cte.entity_category)::text = (tmnsa.tm_nsa_type_id)::text)
  • Rows Removed by Join Filter: 55
10. 7.155 7.186 ↓ 5.0 5 1

Index Scan using idx_entity_type_coords_dates on entity e_cte (cost=6.50..6,328.37 rows=1 width=284) (actual time=2.245..7.186 rows=5 loops=1)

  • Index Cond: ((entity_type = ANY ('{2,4,5}'::integer[])) AND (location_point_easting >= 375000) AND (location_point_easting <= 475000) AND (location_point_northing >= 175000) AND (location_point_northing <= 275000) AND (start_date <= to_date('31/12/2018 00:00:00'::text, 'DD/MM/YYYY HH24:MI:SS'::text)) AND (end_date >= to_date('01/10/2018 00:00:00'::text, 'DD/MM/YYYY HH24:MI:SS'::text)))
  • Filter: (active AND (COALESCE(tomtom__max_average_speed, '-9'::double precision) >= '0'::double precision) AND ((entity_type <> 2) OR (hashed SubPlan 2)) AND (COALESCE((tm__sw_cancelled_status)::integer, 0) = 0))
  • Rows Removed by Filter: 1537
11.          

SubPlan (forIndex Scan)

12. 0.031 0.031 ↑ 1.0 82 1

Index Only Scan using organisation_extended_funcs_pkey on organisation_extended_funcs (cost=0.27..5.72 rows=83 width=4) (actual time=0.009..0.031 rows=82 loops=1)

  • Index Cond: (extended_function_id = 14)
  • Heap Fetches: 0
13. 0.110 0.110 ↑ 1.0 11 5

Seq Scan on tm_nsa tmnsa (cost=0.00..3.26 rows=11 width=37) (actual time=0.005..0.022 rows=11 loops=5)

  • Filter: ((tm_nsa_type_id)::text = ANY ('{TMNSA21,TMNSA22,TMNSA23,TMNSA24,TMNSA01,TMNSA42,TMNSA41,TMNSA43,TMNSA46,TMNSA30,TMNSA32}'::text[]))
  • Rows Removed by Filter: 42
14. 0.000 0.000 ↓ 0.0 0

Seq Scan on entity_category lku_ec (cost=0.00..2.91 rows=91 width=29) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on entity_category_lang lku_ec_lang (cost=0.00..3.11 rows=1 width=45) (never executed)

  • Filter: ((code)::text = 'en'::text)
16. 0.000 0.000 ↓ 0.0 0

Seq Scan on orgref lku_orgref (cost=0.00..40.38 rows=1,298 width=26) (never executed)

  • Filter: (active = 1)
17. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on la (cost=4.28..8.30 rows=1 width=15) (never executed)

  • Recheck Cond: (e_cte.lha_id = la_id)
18. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on la_pkey (cost=0.00..4.28 rows=1 width=0) (never executed)

  • Index Cond: (e_cte.lha_id = la_id)
19. 0.014 7.404 ↓ 0.0 0 1

Sort (cost=0.64..0.64 rows=2 width=832) (actual time=7.404..7.404 rows=0 loops=1)

  • Sort Key: d.id, d.theme_id, d.descriptor1, d.descriptor2, d.descriptor3, d.descriptor4, d.roadlocation, d.start_date, d.end_date, d.date_updated, d.swa_org_name_display, d.geom_type, d.layer_code, d.lat, d.lon, d.geojson_wgs84, d.tomtom__max_average_speed
  • Sort Method: quicksort Memory: 25kB
20. 0.001 7.390 ↓ 0.0 0 1

Append (cost=0.00..0.62 rows=2 width=832) (actual time=7.390..7.390 rows=0 loops=1)

21. 0.002 7.386 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.30 rows=1 width=832) (actual time=7.386..7.386 rows=0 loops=1)

  • Join Filter: ((d.location_bng && gtab.bbox) AND _st_intersects(d.location_bng, gtab.bbox))
22. 0.063 0.063 ↑ 1.0 1 1

CTE Scan on gtab (cost=0.00..0.02 rows=1 width=32) (actual time=0.062..0.063 rows=1 loops=1)

23. 7.321 7.321 ↓ 0.0 0 1

CTE Scan on homogenized_geoms d (cost=0.00..0.02 rows=1 width=864) (actual time=7.321..7.321 rows=0 loops=1)

24. 0.002 0.003 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.30 rows=1 width=832) (actual time=0.003..0.003 rows=0 loops=1)

  • Join Filter: ((d_1.location_point_bng && gtab_1.bbox) AND _st_intersects(d_1.location_point_bng, gtab_1.bbox))
25. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on gtab gtab_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

26. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on homogenized_geoms d_1 (cost=0.00..0.02 rows=1 width=864) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (location_bng IS NULL)