Home › Forums › kdb+ › Question about query that stuck the KDB process › Re: Question about query that stuck the KDB process
-
Looks like you have already spotted part of the problem. The
/
does not denote Divide%
but the iteration operator Over. Depending on the values in thesize
column, you might have inadvertently specified a Converge iteration, and one that might not actually converge. Iterations defined this way run very tight and can be difficult to interrupt.The result column you want is perhaps
sums[size]%sum[size]
, or, avoiding computing bothsum
andsums
,
.[%]1 lastsums size
.q)show size:5?10 6 6 1 8 5 q)sums[size]%sum[size] 0.2307692 0.4615385 0.5 0.8076923 1 q).[%]1 lastsums size 0.2307692 0.4615385 0.5 0.8076923 1
The use above of
1 last
is an example of the Zen monks idiom.