Consider a table of ohlcv data:
date ticker open close high low volume exch time
-----------------------------------------------------------------------------------------------
2024.05.02 NVDA 173 173.7 173.95 173 870 NASDAQ 2024.05.02D09:15:00.000000000
2024.05.02 NVDA 173.85 173 173.85 173 2290 NASDAQ 2024.05.02D09:16:00.000000000
2024.05.02 NVDA 173.55 173.5 173.55 173.25 382 NASDAQ 2024.05.02D09:17:00.000000000
2024.05.02 NVDA 173.5 173.5 173.5 173.5 10 NASDAQ 2024.05.02D09:18:00.000000000
2024.05.02 NVDA 173.65 173.05 173.65 173.05 435 NASDAQ 2024.05.02D09:19:00.000000000
2024.05.02 NVDA 173.1 172.9 173.1 172.9 1902 NASDAQ 2024.05.02D09:20:00.000000000
2024.05.02 NVDA 172.6 172.45 172.6 172.05 824 NASDAQ 2024.05.02D09:21:00.000000000
and it’s sorted on both ticker
and time
via
ohlcv: `ticker`time xasc ohlcv;
yielding
q)meta ohlcv
c | t f a
------| -----
date | d
ticker| s s
open | f
close | f
high | f
low | f
volume| f
exch | s
time | p
Clearly from the above, only ticker
is sorted, but time
is not. However, from the data one also observes that the table is both partitioned and grouped on the ticker
column which leads me to my question.
Which of these attributes do I choose to set? And how about the time
column? I suppose it’s application dependent. If so, what’s the best practice?