explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ah2j

Settings
# exclusive inclusive rows x rows loops node
1. 1.092 6.645 ↑ 2.8 792 1

Sort (cost=3,429.09..3,434.65 rows=2,225 width=354) (actual time=6.521..6.645 rows=792 loops=1)

  • Sort Key: departure
  • Sort Method: quicksort Memory: 161kB
2. 4.527 5.553 ↑ 2.8 792 1

Bitmap Heap Scan on route (cost=74.44..3,305.38 rows=2,225 width=354) (actual time=1.118..5.553 rows=792 loops=1)

  • Recheck Cond: (((loading_datetime >= '2020-01-01 00:00:00'::timestamp without time zone) AND (loading_datetime <= '2020-01-31 23:59:59'::timestamp without time zone)) OR ((unloading_datetime >= '2020-01-01 00:00:00'::timestamp without time zone) AND (unloading_datetime <= '2020-01-31 23:59:59'::timestamp without time zone)) OR (to_timestamp('2020-01-01 00:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) <= unloading_datetime) OR (to_timestamp('2020-01-31 23:59:59'::text, 'YYYY-MM-DD HH24:MI:SS'::text) <= unloading_datetime))
  • Filter: ((firm_id = 12) AND (((loading_datetime >= '2020-01-01 00:00:00'::timestamp without time zone) AND (loading_datetime <= '2020-01-31 23:59:59'::timestamp without time zone)) OR ((unloading_datetime >= '2020-01-01 00:00:00'::timestamp without time zone) AND (unloading_datetime <= '2020-01-31 23:59:59'::timestamp without time zone)) OR ((to_timestamp('2020-01-01 00:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) >= loading_datetime) AND (to_timestamp('2020-01-01 00:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) <= unloading_datetime)) OR ((to_timestamp('2020-01-31 23:59:59'::text, 'YYYY-MM-DD HH24:MI:SS'::text) >= loading_datetime) AND (to_timestamp('2020-01-31 23:59:59'::text, 'YYYY-MM-DD HH24:MI:SS'::text) <= unloading_datetime))))
  • Rows Removed by Filter: 69
  • Heap Blocks: exact=176
3. 0.003 1.026 ↓ 0.0 0 1

BitmapOr (cost=74.44..74.44 rows=3,192 width=0) (actual time=1.026..1.026 rows=0 loops=1)

4. 0.282 0.282 ↓ 1.2 579 1

Bitmap Index Scan on transport_route_loading_datetime_index (cost=0.00..13.30 rows=488 width=0) (actual time=0.282..0.282 rows=579 loops=1)

  • Index Cond: ((loading_datetime >= '2020-01-01 00:00:00'::timestamp without time zone) AND (loading_datetime <= '2020-01-31 23:59:59'::timestamp without time zone))
5. 0.271 0.271 ↓ 1.6 850 1

Bitmap Index Scan on transport_route_unloading_datetime_index (cost=0.00..13.88 rows=546 width=0) (actual time=0.271..0.271 rows=850 loops=1)

  • Index Cond: ((unloading_datetime >= '2020-01-01 00:00:00'::timestamp without time zone) AND (unloading_datetime <= '2020-01-31 23:59:59'::timestamp without time zone))
6. 0.450 0.450 ↑ 1.6 861 1

Bitmap Index Scan on transport_route_unloading_datetime_index (cost=0.00..26.56 rows=1,352 width=0) (actual time=0.450..0.450 rows=861 loops=1)

  • Index Cond: (to_timestamp('2020-01-01 00:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) <= unloading_datetime)
7. 0.020 0.020 ↑ 73.3 11 1

Bitmap Index Scan on transport_route_unloading_datetime_index (cost=0.00..18.47 rows=806 width=0) (actual time=0.020..0.020 rows=11 loops=1)

  • Index Cond: (to_timestamp('2020-01-31 23:59:59'::text, 'YYYY-MM-DD HH24:MI:SS'::text) <= unloading_datetime)
Planning time : 5.415 ms
Execution time : 7.033 ms