سؤال

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