vinyl: disable deferred deletes by default
When the deferred DELETE optimization was introduced, it was enabled for all Vinyl spaces. Though the optimization should improve write performance, at the same time it may result in significant degradation of reads. Let's disable this optimization by default and add a space option to enable it. Closes #4501 @TarantoolBot document Title: Document defer_deletes space option The new option is a boolean flag that only makes sense for Vinyl spaces that have secondary indexes. Setting the flag results in deferring generation of DELETE statements for secondary indexes till compaction of the primary index. It should speed up writes, because it eliminates a lookup in the space for REPLACE and DELETE operations. At the same time, it may result in degradation of reads from secondary indexes, because it entails an additional lookup in the primary index per each "phantom" tuple (a tuple that was deleted in the primary index, but not yet in the secondary index, and hence should be skipped on read). Example: ```lua box.schema.space.create('test', { engine = 'vinyl', defer_deletes = true, }) ``` If omitted on space creation, this option is set to the value of `box.cfg.vinyl_defer_deletes`, which is false by default.
Showing
- changelogs/unreleased/gh-4501-vinyl-disable-deferred-deletes.md 6 additions, 0 deletions...logs/unreleased/gh-4501-vinyl-disable-deferred-deletes.md
- src/box/lua/load_cfg.lua 3 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/lua/schema.lua 13 additions, 1 deletionsrc/box/lua/schema.lua
- src/box/lua/space.cc 6 additions, 0 deletionssrc/box/lua/space.cc
- src/box/space_def.c 2 additions, 0 deletionssrc/box/space_def.c
- src/box/space_def.h 6 additions, 0 deletionssrc/box/space_def.h
- src/box/vinyl.c 12 additions, 6 deletionssrc/box/vinyl.c
- test/app-tap/init_script.result 1 addition, 0 deletionstest/app-tap/init_script.result
- test/box/admin.result 2 additions, 0 deletionstest/box/admin.result
- test/box/cfg.result 4 additions, 0 deletionstest/box/cfg.result
- test/vinyl-luatest/gh_4501_defer_deletes_option_test.lua 120 additions, 0 deletionstest/vinyl-luatest/gh_4501_defer_deletes_option_test.lua
- test/vinyl/deferred_delete.result 12 additions, 0 deletionstest/vinyl/deferred_delete.result
- test/vinyl/deferred_delete.test.lua 4 additions, 0 deletionstest/vinyl/deferred_delete.test.lua
- test/vinyl/errinj.result 1 addition, 1 deletiontest/vinyl/errinj.result
- test/vinyl/errinj.test.lua 1 addition, 1 deletiontest/vinyl/errinj.test.lua
- test/vinyl/gh-6448-deferred-delete-in-dropped-space.result 1 addition, 1 deletiontest/vinyl/gh-6448-deferred-delete-in-dropped-space.result
- test/vinyl/gh-6448-deferred-delete-in-dropped-space.test.lua 1 addition, 1 deletiontest/vinyl/gh-6448-deferred-delete-in-dropped-space.test.lua
- test/vinyl/json.result 1 addition, 1 deletiontest/vinyl/json.result
- test/vinyl/json.test.lua 1 addition, 1 deletiontest/vinyl/json.test.lua
- test/vinyl/layout.result 1 addition, 1 deletiontest/vinyl/layout.result
Loading
Please register or sign in to comment