primary_index_fieldno_map is not cached
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 43
- Forks
- 17
- Avg merge
- 28m
- Merged PRs (30d)
- 2
Description
local function extract_from_index(primary_key, primary_index_parts, sharding_key_as_index_obj)
dev_checks('table', 'table', 'table')
local primary_index_fieldno_map = utils.get_index_fieldno_map(primary_index_parts)
We re-calculate this map on each request. At least, please, mark it as possible speed up headroom: we can cache this value.
As an option, we can do this right in the shadring key definitions fetching code and get rid of the primary_index_parts argument in sharding_key_module.extract_from_pk().
https://github.com/tarantool/crud/pull/181#discussion_r748678350
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at extract_from_index(), where utils.get_index_fieldno_map(primary_index_parts) is called, and read the linked pull request discussion for the proposed caching options. Determine whether the map should be cached or prepared during sharding-key definition fetching, then verify that it is no longer recalculated on each request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100