vinyl: skip needless checks for duplicates on INSERT
If a unique index includes all parts of another unique index, we can skip the check for duplicates for it on INSERT. Let's mark all such indexes with a special flag on CREATE/ALTER and optimize out the check if the flag is set. If there are two indexes that index the same set of fields, check uniqueness for the one with a lower id, because it is likelier to have have a "warmer" cache. Closes #3154
Showing
- src/box/key_def.cc 12 additions, 0 deletionssrc/box/key_def.cc
- src/box/key_def.h 9 additions, 0 deletionssrc/box/key_def.h
- src/box/vinyl.c 29 additions, 5 deletionssrc/box/vinyl.c
- src/box/vy_index.c 1 addition, 0 deletionssrc/box/vy_index.c
- src/box/vy_index.h 7 additions, 0 deletionssrc/box/vy_index.h
- test/vinyl/misc.result 63 additions, 0 deletionstest/vinyl/misc.result
- test/vinyl/misc.test.lua 25 additions, 0 deletionstest/vinyl/misc.test.lua
Loading
Please register or sign in to comment