explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IOT0

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 14.632 ↑ 2.0 1 1

Unique (cost=4,411.94..4,412.03 rows=2 width=832) (actual time=14.631..14.632 rows=1 loops=1)

2.          

CTE gtab

3. 0.059 0.059 ↑ 1.0 1 1

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

4.          

CTE homogenized_geoms

5. 0.468 14.393 ↓ 30.0 30 1

Nested Loop Left Join (cost=11.06..4,411.04 rows=1 width=945) (actual time=0.840..14.393 rows=30 loops=1)

6. 0.050 13.835 ↓ 30.0 30 1

Nested Loop Left Join (cost=6.78..4,402.21 rows=1 width=383) (actual time=0.801..13.835 rows=30 loops=1)

7. 0.026 13.695 ↓ 30.0 30 1

Nested Loop Left Join (cost=6.50..4,397.91 rows=1 width=365) (actual time=0.791..13.695 rows=30 loops=1)

  • Join Filter: ((e_cte.entity_category)::text = (lku_ec_lang.nsa_code)::text)
8. 0.775 13.399 ↓ 30.0 30 1

Nested Loop Left Join (cost=6.50..4,394.78 rows=1 width=335) (actual time=0.776..13.399 rows=30 loops=1)

  • Join Filter: ((e_cte.entity_category)::text = (lku_ec.nsa_code)::text)
  • Rows Removed by Join Filter: 2700
9. 0.916 11.964 ↓ 30.0 30 1

Nested Loop (cost=6.50..4,390.73 rows=1 width=313) (actual time=0.750..11.964 rows=30 loops=1)

  • Join Filter: ((e_cte.entity_category)::text = (tmnsa.tm_nsa_type_id)::text)
  • Rows Removed by Join Filter: 2819
10. 5.836 5.868 ↓ 259.0 259 1

Index Scan using idx_entity_type_coords_dates on entity e_cte (cost=6.50..4,387.34 rows=1 width=284) (actual time=0.142..5.868 rows=259 loops=1)

  • Index Cond: ((entity_type = ANY ('{2,4,5}'::integer[])) AND (location_point_easting >= 393214) AND (location_point_easting <= 480509) AND (location_point_northing >= 245607) AND (location_point_northing <= 308006) AND (start_date <= to_date('31/10/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, '-1'::double precision) >= '-1'::double precision) AND ((entity_type <> 2) OR (hashed SubPlan 2)) AND (COALESCE((tm__sw_cancelled_status)::integer, 0) = 0))
  • Rows Removed by Filter: 338
11.          

SubPlan (forIndex Scan)

12. 0.032 0.032 ↑ 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.010..0.032 rows=82 loops=1)

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

Seq Scan on tm_nsa tmnsa (cost=0.00..3.26 rows=11 width=37) (actual time=0.003..0.020 rows=11 loops=259)

  • 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.660 0.660 ↑ 1.0 91 30

Seq Scan on entity_category lku_ec (cost=0.00..2.91 rows=91 width=29) (actual time=0.001..0.022 rows=91 loops=30)

15. 0.270 0.270 ↓ 0.0 0 30

Seq Scan on entity_category_lang lku_ec_lang (cost=0.00..3.11 rows=1 width=45) (actual time=0.009..0.009 rows=0 loops=30)

  • Filter: ((code)::text = 'en'::text)
  • Rows Removed by Filter: 89
16. 0.090 0.090 ↑ 1.0 1 30

Index Only Scan using idx_lku_orgref_123 on orgref lku_orgref (cost=0.28..4.30 rows=1 width=26) (actual time=0.003..0.003 rows=1 loops=30)

  • Index Cond: ((active = 1) AND (organisation_id = e_cte.publisher_organisation_id))
  • Heap Fetches: 0
17. 0.030 0.090 ↑ 1.0 1 30

Bitmap Heap Scan on la (cost=4.28..8.30 rows=1 width=15) (actual time=0.003..0.003 rows=1 loops=30)

  • Recheck Cond: (e_cte.lha_id = la_id)
  • Heap Blocks: exact=30
18. 0.060 0.060 ↑ 1.0 1 30

Bitmap Index Scan on la_pkey (cost=0.00..4.28 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=30)

  • Index Cond: (e_cte.lha_id = la_id)
19. 0.019 14.630 ↑ 2.0 1 1

Sort (cost=0.64..0.64 rows=2 width=832) (actual time=14.629..14.630 rows=1 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.002 14.611 ↑ 2.0 1 1

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

21. 0.074 14.596 ↑ 1.0 1 1

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

  • Join Filter: ((d.location_bng && gtab.bbox) AND _st_intersects(d.location_bng, gtab.bbox))
  • Rows Removed by Join Filter: 29
22. 0.062 0.062 ↑ 1.0 1 1

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

23. 14.460 14.460 ↓ 30.0 30 1

CTE Scan on homogenized_geoms d (cost=0.00..0.02 rows=1 width=864) (actual time=0.843..14.460 rows=30 loops=1)

24. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.30 rows=1 width=832) (actual time=0.013..0.013 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.002 0.002 ↑ 1.0 1 1

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

26. 0.010 0.010 ↓ 0.0 0 1

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

  • Filter: (location_bng IS NULL)
  • Rows Removed by Filter: 30