database - How to join splayed table in KDB? -
i have 2 large (billions of rows) splayed tables, trades
, stockprices
, on remote server. want asof join
h:hopen `:remoteserver:port h"aj[`stock`date`time, select trades date within 2014.04.01 2014.04.13, stockprices ]"
but error (i'm studio kdb+)
an error occurred during execution of query. server sent response: splay studio hint: possibly error refers nyi op on splayed table
so correct way such join?
also, performance , efficiency issue such big table -- should doing ensure query doesn't take hours , doesn't consume of server's system resources?
you need map splayed stockprices
table memory. can done using select
query:
q)(`::6060)"aj[`sym`time;select trade;quote]" / bad 'splay q)(`::6060)"aj[`sym`time;select trade;select quote]" / sym time prx bid ask ------------------------------------------- aea 01:01:16.347 637.7554 866.0131 328.1476 aea 01:59:14.108 819.5301 115.053 208.1114 aea 02:42:44.724 69.38325 641.8554 333.3092
this page may useful looking errors kdb+: http://code.kx.com/wiki/errors
regarding optimising performance of aj
see http://code.kx.com/wiki/reference/aj
also, if there isn't overlap of data between days, may faster run query on day day basis, possibly in parallel.
if there overlap of data across days, combining date & time columns single timestamp column speed lookup.
Comments
Post a Comment