Question

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).

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top