문제

I have created a trade database on my local machine, partitioned by date.

select from trade where date=x

Takes about 100 ms, but when I do:

select from trade where date=x,sym=`alpha

it takes ~1-3 seconds.

Is there a trick I'm missing (using `g#sym gives an error 'par).

도움이 되었습니까?

해결책

You can use dbmaint.q to apply attributes to to partitioned tables. See here . Specifially look at the setattrcol function. Adding an attribute will speed up the query significantly. I would suggest using a p# on the id column if possible. This should be faster for look-ups but is more difficult to maintain.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top