tarantool / tarantool/tarantool

Optimize BPS tree for point lookups

Open
#2,641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

Add a new API method to BPS tree to remove the code like this:

	struct tree_mem_key tree_key;
	tree_key.stmt = itr->key;
	tree_key.lsn = (*itr->p_read_view)->vlsn;
	bool exact;
	struct vy_mem_tree_iterator mem_itr =
		vy_mem_tree_lower_bound(&mem->tree, &tree_key, &exact);
	itr->index->stat.memory.iterator.lookup++;
	const struct tuple *stmt = NULL;
	if (!vy_mem_tree_iterator_is_invalid(&mem_itr)) {
		stmt = *vy_mem_tree_iterator_get_elem(&mem->tree, &mem_itr);
		if (vy_stmt_compare(stmt, itr->key, mem->cmp_def) != 0)
			stmt = NULL;
	}

Contributor guide

Open the contributing guide

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 the shown vy_mem_tree_lower_bound call and trace the BPS tree implementation and its callers. Define the new point-lookup API around the key, LSN, and exact-match check shown, then verify that existing lookup behavior and statistics remain correct with focused tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
databases, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.