I want to remove some rows from a partitioned database table, but this query won't work:
delete from myPartTable where date=2013.05.30,col1<>"A"
I'd rather not load the whole table into memory, remove from the rdb, and then write back to disk. Can I remove from the disk table directly?
kdb by itself does not provide an easy method of manipulating partitioned tables. Two options:
To reduce memory usage get the indices of the rows you want to delete. Go through on a per column basis and delete. This is the standard practice when reducing memory usage for partitioned database operations.
Maintain a column that marks whether that row is deleted update that boolean as necessary to mark deletions. This would give faster deletions at the cost of slowing every select that would have to filter on where not deleted. At a later time, actually remove the rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With