vinyl: move update optimization from write iterator to tx
An UPDATE operation is written as DELETE + REPLACE to secondary indexes. We write those statements to the memory level even if the UPDATE doesn't actually update columns indexed by a secondary key. We filter them out in the write iterator when the memory level is dumped. That's what we use vy_stmt_column_mask for. Actually, there's no point to keep those statements until dump - we could as well filter them out when the transaction is committed. This would even save some memory. This wouldn't hurt read operations, because point lookup doesn't work for secondary indexes by design and so we have to read all sources, including disk, on every read from a secondary index. That said, let's move update optimization from the write iterator to vy_tx_commit. This is a step towards removing vy_stmt_column_mask.
Showing
- src/box/vy_tx.c 9 additions, 2 deletionssrc/box/vy_tx.c
- src/box/vy_write_iterator.c 12 additions, 32 deletionssrc/box/vy_write_iterator.c
- src/box/vy_write_iterator.h 3 additions, 23 deletionssrc/box/vy_write_iterator.h
- test/unit/vy_cache.c 4 additions, 5 deletionstest/unit/vy_cache.c
- test/unit/vy_iterators_helper.c 6 additions, 16 deletionstest/unit/vy_iterators_helper.c
- test/unit/vy_iterators_helper.h 3 additions, 16 deletionstest/unit/vy_iterators_helper.h
- test/unit/vy_point_lookup.c 1 addition, 1 deletiontest/unit/vy_point_lookup.c
- test/unit/vy_write_iterator.c 3 additions, 102 deletionstest/unit/vy_write_iterator.c
- test/unit/vy_write_iterator.result 23 additions, 31 deletionstest/unit/vy_write_iterator.result
Loading
Please register or sign in to comment