tarantool / tarantool/crud

primary_index_fieldno_map is not cached

Open
#243 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

performance
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.