cancel
Showing results for 
Search instead for 
Did you mean: 

Question on sorting a large partitioned table

jackyyuk
New Contributor II

Hello,

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

{ t:`colA`colB xasc select from `:<dir_source>/<date>/<trade>;

  (`:<dir_destination>/<date>/<trade>;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

1 REPLY 1

fbodon
New Contributor II
New Contributor II

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