I was trying to measure data access times for a db I had created. It was taking ~1s for one day's data. To aggregate I ran the following code. I am using kdb studio and there are ~1MM trades in total every day
\t ans: raze {select from trade where date=x, sym=`ABC} each 20#dtl
dtl was the entire list of dates. I closed the server and ran it again and surprisingly this took <1 second. As this was contrary to what I had observed above, I ran this
\t ans: raze {select from trade where date=x, sym=`ABC} each 20#20_dtl
and now it took ~21 seconds. My question is if i close the kdb server, is it possible for q to still cache some of the previous results?
This is likely due to your operating system caching the data it reads from disk. Kdb+ provides no inbuilt caching by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With