Hi All,
I have a large files of around 500mb with around 25 columns which have a imported into KDB.
The file contains a mixture of symbols, varchar and integers in the table which I call tX
For instance a subset of the meta data I import looks like this
meta tXc t f aid sti ip fstr1 Cstr2 Cstr3 Cstr4 Cstr5 C
I want to store this file as a splay so
- can create a empty splay table
empty tablesX: ([] id:
symbol$(); ti:int$() ; p:
float$(); str1:(); str2(); str3(); str4(); str5())`
or
table with nullssX: ([] id:enlist
; ti:enlist 0Ni ; p:enlist 0n; str1:enlist “None”; str2: enlist “None” str3: enlist “None”; str4: enlist “None”; str5: “None”)`
- enumerate and create a splay sX
sX: .Q.en[
:c:/test] sX:c:/test/sX/ set sX
- and upsert the table tX
tX: .Q.en[
:c:/test] tX:c:/test/sX/ upsert tX
For the empty sX table (the first one) kdb hangs but for the null sX table (the second one) it works and splays the table as expected.
However if I now type
meta sX
it takes more that 60s to calculate. In fact any calculation is very slow on this splay table. However the calculation on tX (the imported table) is fast. In addition if I cast everything to symbols and then splay the table, the calculations is fast.
I have been trying to replicate this error in a small piece of code without success. It seems to be specific the the table I am loading. Does anyone have any ideas or suggestions of where I am going wrong. I am completely at a loss…
Could there be special characters that are not allowed in varchar?
Is there a limit on the number of varchar columns?
Any advice would be greatly appreciated.
Thanks
David