explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BgyQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 0.084 ↓ 2.0 2 1

Nested Loop (cost=1.63..13.37 rows=1 width=502) (actual time=0.064..0.084 rows=2 loops=1)

2. 0.012 0.039 ↓ 2.0 2 1

Hash Right Join (cost=1.49..2.89 rows=1 width=478) (actual time=0.036..0.039 rows=2 loops=1)

  • Hash Cond: (offers.transfer_id = transfers.id)
  • Filter: ((offers.id IS NULL) OR (offers.status = 'canceled'::enum_offer_status))
  • Rows Removed by Filter: 1
3. 0.009 0.009 ↓ 1.1 19 1

Seq Scan on offers (cost=0.00..1.29 rows=18 width=12) (actual time=0.006..0.009 rows=19 loops=1)

  • Filter: (carrier_id = 1)
  • Rows Removed by Filter: 4
4. 0.002 0.018 ↑ 2.3 3 1

Hash (cost=1.40..1.40 rows=7 width=478) (actual time=0.018..0.018 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
5. 0.016 0.016 ↑ 2.3 3 1

Seq Scan on transfers (cost=0.00..1.40 rows=7 width=478) (actual time=0.012..0.016 rows=3 loops=1)

  • Filter: (status = 'new'::enum_transfer_status)
  • Rows Removed by Filter: 32
6. 0.016 0.030 ↑ 1.0 1 2

Index Scan using trips_transfer_id_index on trips (cost=0.14..7.61 rows=1 width=16) (actual time=0.014..0.015 rows=1 loops=2)

  • Index Cond: (transfer_id = transfers.id)
  • Filter: ((((date > '2019-01-22 21:24:00+03'::timestamp with time zone) AND ((date - '2019-01-22 21:24:00+03'::timestamp with time zone) < '02:00:00'::interval)) OR ((date > '2019-01-31 20:54:00+03'::timestamp with time zone) AND ((date - '2019-01-31 20:54:00+03'::timestamp with time zone) < '02:00:00'::interval))) AND (((date > '2019-01-22 21:24:00+03'::timestamp with time zone) AND ((date - '2019-01-22 21:24:00+03'::timestamp with time zone) < '02:00:00'::interval) AND (CASE type WHEN 'to'::enum_trip_type THEN (SubPlan 3) ELSE (SubPlan 4) END <@ '<(59.9342802,30.3350986),0.3>'::circle)) OR ((date > '2019-01-31 20:54:00+03'::timestamp with time zone) AND ((date - '2019-01-31 20:54:00+03'::timestamp with time zone) < '02:00:00'::interval) AND (CASE type WHEN 'to'::enum_trip_type THEN (SubPlan 5) ELSE (SubPlan 6) END <@ '<(59.4502725,24.7362971),0.3>'::circle))))
7.          

SubPlan (forIndex Scan)

8. 0.000 0.000 ↓ 0.0 0

Seq Scan on city_points city_points_2 (cost=0.00..1.43 rows=1 width=16) (never executed)

  • Filter: (transfers.city_point_from_id = id)
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on city_points city_points_3 (cost=0.00..1.43 rows=1 width=16) (never executed)

  • Filter: (transfers.city_point_to_id = id)
10. 0.014 0.014 ↑ 1.0 1 2

Seq Scan on city_points city_points_4 (cost=0.00..1.43 rows=1 width=16) (actual time=0.005..0.007 rows=1 loops=2)

  • Filter: (transfers.city_point_from_id = id)
  • Rows Removed by Filter: 35
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on city_points city_points_5 (cost=0.00..1.43 rows=1 width=16) (never executed)

  • Filter: (transfers.city_point_to_id = id)
12.          

SubPlan (forNested Loop)

13. 0.010 0.010 ↑ 1.0 1 2

Seq Scan on city_points (cost=0.00..1.43 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=2)

  • Filter: (transfers.city_point_from_id = id)
  • Rows Removed by Filter: 35
14. 0.000 0.000 ↓ 0.0 0

Seq Scan on city_points city_points_1 (cost=0.00..1.43 rows=1 width=16) (never executed)

  • Filter: (transfers.city_point_to_id = id)