explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DagD

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

CTE Scan on tm_items (cost=9,843.55..9,843.75 rows=10 width=6,715) (actual time=16.706..16.706 rows=0 loops=1)

2.          

CTE live_orgs

3. 0.033 0.047 ↑ 1.0 104 1

Bitmap Heap Scan on organisation_extended_funcs (cost=5.10..11.44 rows=107 width=4) (actual time=0.023..0.047 rows=104 loops=1)

  • Recheck Cond: (extended_function_id = 14)
  • Heap Blocks: exact=5
4. 0.014 0.014 ↑ 1.0 106 1

Bitmap Index Scan on organisation_extended_funcs_pkey (cost=0.00..5.08 rows=107 width=0) (actual time=0.014..0.014 rows=106 loops=1)

  • Index Cond: (extended_function_id = 14)
5.          

CTE tm_items

6. 0.164 16.705 ↓ 0.0 0 1

Nested Loop (cost=4.90..9,832.11 rows=10 width=4,698) (actual time=16.705..16.705 rows=0 loops=1)

7. 0.886 13.805 ↓ 10.8 1,368 1

Hash Join (cost=4.47..7,352.38 rows=127 width=4,698) (actual time=0.158..13.805 rows=1,368 loops=1)

  • Hash Cond: (e_cte.publisher_organisation_id = live_org.organisation_id)
8. 2.097 12.832 ↓ 5.1 1,371 1

Nested Loop (cost=0.99..7,346.62 rows=269 width=4,702) (actual time=0.064..12.832 rows=1,371 loops=1)

9. 6.622 6.622 ↓ 5.1 1,371 1

Index Scan using idx_item_et_type_coords_datee on item i_cte (cost=0.56..5,072.22 rows=269 width=4,681) (actual time=0.052..6.622 rows=1,371 loops=1)

  • Index Cond: ((item_entity_type = 2) AND ((item_type)::text = ANY ('{RC,DC}'::text[])) AND (location_point_easting >= 385816) AND (location_point_easting <= 406245) AND (location_point_northing >= 235894) AND (location_point_northing <= 248403) AND (start_date <= (LOCALTIMESTAMP + '1 day'::interval)) AND (end_date <= LOCALTIMESTAMP))
  • Filter: active
  • Rows Removed by Filter: 133
10. 4.113 4.113 ↑ 1.0 1 1,371

Index Scan using pk_entity on entity e_cte (cost=0.44..8.46 rows=1 width=29) (actual time=0.003..0.003 rows=1 loops=1,371)

  • Index Cond: (entity_id = i_cte.entity_id)
11. 0.016 0.087 ↑ 1.0 104 1

Hash (cost=2.14..2.14 rows=107 width=4) (actual time=0.087..0.087 rows=104 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
12. 0.071 0.071 ↑ 1.0 104 1

CTE Scan on live_orgs live_org (cost=0.00..2.14 rows=107 width=4) (actual time=0.025..0.071 rows=104 loops=1)

13. 2.736 2.736 ↓ 0.0 0 1,368

Index Scan using idx_schedule_item_id on schedule sche (cost=0.42..19.41 rows=11 width=10) (actual time=0.002..0.002 rows=0 loops=1,368)

  • Index Cond: (item_id = i_cte.item_id)
  • Filter: ((cancelled IS DISTINCT FROM true) AND (actual_start_date < CURRENT_TIMESTAMP) AND (actual_end_date > CURRENT_TIMESTAMP))
Planning time : 1.582 ms
Execution time : 16.876 ms