alter: require rebuild of all secondary vinyl indexes if pk changes
If the primary key is modified, we schedule rebuild of all non-unique (including nullable) secondary TREE indexes. This is valid for memtx, but is not quite right for vinyl. For vinyl we have to rebuild all secondary indexes, because they are all non-clustered (i.e. point to tuples via primary key parts). This doesn't result in any bugs for now, because rebuild of vinyl indexes is not supported, but hopefully this is going to change soon. So let's introduce a new virtual index method, index_vtab::depends_on_pk, which returns true iff the index needs to be updated if the primary key changes, and define this new method for vinyl and memtx TREE indexes.
Showing
- src/box/alter.cc 4 additions, 7 deletionssrc/box/alter.cc
- src/box/index.cc 5 additions, 0 deletionssrc/box/index.cc
- src/box/index.h 13 additions, 0 deletionssrc/box/index.h
- src/box/memtx_bitset.c 1 addition, 0 deletionssrc/box/memtx_bitset.c
- src/box/memtx_hash.c 1 addition, 0 deletionssrc/box/memtx_hash.c
- src/box/memtx_rtree.c 1 addition, 0 deletionssrc/box/memtx_rtree.c
- src/box/memtx_tree.c 9 additions, 0 deletionssrc/box/memtx_tree.c
- src/box/sysview_index.c 1 addition, 0 deletionssrc/box/sysview_index.c
- src/box/vinyl.c 12 additions, 0 deletionssrc/box/vinyl.c
Loading
Please register or sign in to comment