Questions tagged [b-tree]
B-trees are a type of self balancing search tree where each node can hold multiple keys and all leaf nodes are the same distance from the root.
b-tree
771
questions
-1
votes
0
answers
25
views
How to traverse VMA in Linux 6.6 version? [duplicate]
In the old version of Linux(5.10), we can traverse VMA like that :
static void walk_vma_range(struct mm_struct *mm, u32 *nr_vma, u32 *nr_pages)
{
struct vm_area_struct *vma = mm->mmap;
u32 ...
0
votes
1
answer
18
views
Issue solving 2-3 B-tree
I do not know how to delete the node 90 from this 2-3 B-tree
and i cant put in a simulator because i would need to replicate the tree exactly and I do not know how to do that. I would really ...
1
vote
1
answer
47
views
Understanding Disk Reads and Cache Misses for B-tree and BST Queries
I am trying to understand how disk reads are handled when performing query operations on B-trees and have TWO questions.
I have the following B-tree structure:
[10, 20]
/ | ...
4
votes
1
answer
113
views
How to implement a non-preemptive splitting insert in a B-tree?
I am working on implementing a non-preemptive splitting insert function for a B-tree. Below is the structure of my B-tree node:
#define KEYS_NUMBER 4 // Max number of keys in a ...
0
votes
1
answer
35
views
Complexity of a multi-column b-tree index
According to one of Sebastian Brestin's posts, a multi-column b-tree index will look like something below. It seems that more columns doesn't create a deeper b-tree. So if a single-column (n entries) ...
1
vote
1
answer
31
views
B-tree insertion problem, error: vector subscript out of range
I'm implementing a B-tree insert function.
But it gets into problems. For inserting 50 elements and below it seems to work fine, but inserting 100 elements yields the error:
vector subscript out of ...
0
votes
1
answer
41
views
Rust BTreeSet insert unique values with duplicate ranking field
I need an ordered set so I'm using BTreeSet. I have an Item struct which contains a unique id, and a rank field which may be duplicated. I only want uniqueness to be considered for the id field and ...
0
votes
1
answer
62
views
PostgreSQL - jsonb index is not being applied
I have a table called users that contains over 2 millions records with the following structure:
create table users {
id integer not null,
langs jsonb
}
The column langs contains the following ...
0
votes
1
answer
92
views
Order of B+ Tree
Looking at different sources, it seems to me that there are two definitions to B+ tree order. The first one is talking about number of entries per node, where the second one is talking about the ...
0
votes
1
answer
60
views
Why do some btree diagrams have multiple nodes at the same level?
Why do some diagrams have no value for each node and instead have 2 values? What are they trying to represent?
The second diagram makes sense if 8 has a left and right node of 6 and 7. I don't ...
0
votes
0
answers
87
views
Why does btreemap's iter not implement count?
I wonder about the Iterator for Iter implementation of BTreeMaps Iter:
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> ...
0
votes
1
answer
67
views
Retrieving minimum value becomes every slow in Postgres
I found a strange problem on Postgresql which retrieving minimum value from a small table with 11 row spent almost 200ms.
Initializing a data, turning off autovacuum and starting it.Then executing ...
0
votes
0
answers
23
views
In what condition db's b-tree index can become unbalanced?
I received an interview question today that surprised me.
You have MySQl with b-tree indexes, after what operations and in what
cases b-tree can become unbalanced?
I thought, that it always ...
1
vote
2
answers
49
views
Why is the index not being used?
I have a table (say table t) with an index on col_a that is unique.
Now the index on col_a is used in these 2 following cases -
SELECT * from t WHERE(col_a,col_b) IN((x,y),(p,q)); - query_1
SELECT * ...
0
votes
0
answers
43
views
Multilevel indexing with B+tree in C++
The issue arises when I initiate the program and opt to display all the books; they appear correctly. However, when I attempt to search for or delete a book, it claims that the book is not found, ...