add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
version
PostgreSQL 12.0 (Debian 12.0-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
14 rows affected
truck_id location_name loc_date_time the_lead
MonsterTruck Home 2019-10-22 10:27:40 2019-10-22 10:27:40
MonsterTruck Home 2019-10-22 10:27:40 2019-10-22 10:33:10
MonsterTruck Home 2019-10-22 10:33:10 2019-10-22 11:22:40
MonsterTruck Home 2019-10-22 11:22:40 2019-10-22 11:22:40
MonsterTruck Home 2019-10-22 11:22:40 2019-10-22 16:43:00
MonsterTruck Home 2019-10-22 11:22:40 2019-10-22 11:22:40
MonsterTruck Gas Station 2019-10-22 12:43:00 2019-10-22 13:13:00
MonsterTruck Gas Station 2019-10-22 13:13:00 2019-10-22 13:43:00
MonsterTruck Gas Station 2019-10-22 13:43:00 null
MonsterTruck Home 2019-10-22 16:43:00 2019-10-22 16:49:00
MonsterTruck Home 2019-10-22 16:49:00 2019-10-22 17:43:00
MonsterTruck Home 2019-10-22 17:43:00 2019-10-22 20:43:00
MonsterTruck Home 2019-10-22 20:43:00 2019-10-22 20:56:00
MonsterTruck Home 2019-10-22 20:56:00 null
truck_id location_name loc_date_time
MonsterTruck Home 2019-10-22 11:22:40
MonsterTruck Gas Station 2019-10-22 13:43:00
MonsterTruck Home 2019-10-22 17:43:00
MonsterTruck Home 2019-10-22 20:56:00
substr location_name loc_date_time t tlag diff
Mon Home 2019-10-22 10:27:40 1571740060 null null
Mon Gas Station 2019-10-22 12:43:00 1571748180 null null
Mon Home 2019-10-22 16:43:00 1571762580 1571743360 19220
Mon Home 2019-10-22 20:43:00 1571776980 1571766180 10800
tid_1 tid_2 loc_1 loc_2 ldt_1 ldt_2 diff
Mon Mon Hom Hom 2019-10-22 10:27:40 2019-10-22 11:22:40 3300
Mon Mon Gas Gas 2019-10-22 12:43:00 2019-10-22 13:43:00 3600
Mon Mon Hom Hom 2019-10-22 16:43:00 2019-10-22 17:43:00 3600
Mon Mon Hom Hom 2019-10-22 20:43:00 2019-10-22 20:56:00 780
?column?
t
?column?
-33620