cancel
Showing results for 
Search instead for 
Did you mean: 

Why kdb does not support sorting dynamically(like java TreeMap, sql

NDTM_idea
New Contributor
I wan to use kdb to maintains my order book, the order book need keep sorted after insert/update/delete
3 REPLIES 3

jamie_halligan
New Contributor
How are you sorting the order book? Kdb+ systems are typically designed around time series data or any other data that is received in some sorted order and does not have to have elements deleted/inserted mid-table often, if ever. Due to the way Kdb stores table data any time a table is modified such that the sorted attribute has to be removed it will take some time to sort the data again. It may be worth trying to find a solution that doesn't require sorting every time. 

just use a grouped table or a dictionary:

o:`g#([]ord:`s$();pirce:`float$();size:`int$())


Attila
New Contributor