Question on sorting a large partitioned table

https://learninghub.kx.com/forums/topic/question-on-sorting-a-large-partitioned-table

Hello,

Currently, I would like to sort a partitioned table by its column colA and colB. I simple perform the following actions:

{ t:colAcolB xasc select from `:<dir_source>//;

(`:<dir_destination>//;17;2;6) set t} for each dates

However, the q service was killed occasionally due to memory usage, as some the table data is very large.

Is there anyway to reduce the memory usage, and prevent the killing?

 

Thanks,

Jacky

You can sort the table column by column using iasc. This approach is described here - see function disksort.

https://code.kx.com/q/wp/intraday-writedown/#wq