I want to get for example first 10 rows from partitioned table in specific date (date is a partition column). The solution is
10# select from trade where date = 2014.01.02
but this query has the same usage of memory as
select from trade where date = 2014.01.02
(I used \ts and get same values for both cases)
so I hope, theres more efficient solution. Any ideas, please?
Thanks Pavel
This isn’t necessary on 64bit, but on 32bit this should reduce your mem load; using functional select, load a column at a time. Here using trade table, last date. Use parse"select
." to figure out how to form functional select.
q)flip raze {flip 10#?[trade;enlist(=;`date;2014.01.02);0b;(enlist x)!enlist x]}each cols trade
select from trade where date=2014.01.02,i within (1;1+10)
or look at
http://code.kx.com/wiki/DotQ/DotQDotind
Thanks,
Sean
address-space/mapping is the problem
hence Charlie’s suggestion
10#..
or
..i<10
does not matter
Cheers,
Attila
Attila
I can’t use i<10 nor select [10] becase it is partitioned table. It tried .Q.ind before, but I waited for resuresult almost half an hour.Selecting by date is quite complicated with .Q.ind and not efficient (searching for starting index of the particilar date).
With 32bit, for ease of querying, you probably don’t want to go above ~500MB per partition.
See http://code.kx.com/wiki/JB:KdbplusForMortals/segments#1.4_Segments
Thank you for all responses. So it looks, there is no less memory consuming solution, the only way is to keep partiones “small” enough.
Dne pátek, 23. kv?tna 2014 19:29:22 UTC+2 Charles Skelton napsal(a):
With 32bit, for ease of querying, you probably don’t want to go above ~500MB per partition.
See http://code.kx.com/wiki/JB:KdbplusForMortals/segments#1.4_Segments