- Posts: 5
- Thank you received: 0
Please Log in or Create an account to join the conversation.
> explain select max(time) from state_vectors_data4;
...
partitions=22001/22001 files=22913 size=4.51TB
> explain select max(time) t from state_vectors_data4 where hour > unix_timestamp(now()) - 6*3600;
...
partitions=2/22002 files=2 size=784.44MB
> explain with curr as (select max(time) t from state_vectors_data4 where hour > unix_timestamp(now()) - 6*3600) select time,icao24,lat,lon FROM curr,state_vectors_data4 WHERE time = t and hour > unix_timestamp(now()) - 6*3600;
> select max(time) t, max(hour) h from state_vectors_data4 where hour > unix_timestamp(now()) - 6*3600;
...
Fetched 1 row(s) in 0.82s
> select time,icao24,lat,lon FROM curr,state_vectors_data4 WHERE time = 1532591999 and hour = 1532588400;
...
Fetched 5836 row(s) in 1.86s
select time,icao24,lat,lon FROM state_vectors_data4 WHERE time in (
select max(time) from state_vectors_data4 where hour > unix_timestamp(now()) - 6*3600
) and hour > unix_timestamp(now()) - 6*3600;
...
Fetched 5836 row(s) in 2.17s
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.