Questions tagged [b-tree-index]
57 questions
2
votes
1 answer
How to get the n-th value of a b-tree
Is there general pseudocode or related data structure to get the nth value of a b-tree? For example, the eighth value of this tree is 13 [1,4,9,9,11,11,12,13].
If I have some values sorted in a b-tree, I would like to find the nth value without…

Jonathan
- 3,893
- 5
- 46
- 77
2
votes
0 answers
Postgres Database Import failing on zero-length identifier using btree ("") (Drupal)
Postgres database problem: I'm trying to import a Postgresql 10 database from a working* Drupal 8 installation and I'm stuck on this type of error:
Error in query: ERROR: zero-length delimited identifier at or near """"
LINE 1: ...ON…

UrsulaAntares
- 51
- 3
2
votes
1 answer
What data structure does Google Firebase Firestore use for it's default index
I'm curious if anyone knows, or can guess, the data structure Google's Firestore is using to index arbitrary NoSQL documents by every field. I'm looking to build something similar, making it as efficient as possible.
Some info about how their…

scosman
- 2,343
- 18
- 34
2
votes
0 answers
MySQL gets long semaphore locks on dict0dict.cc - but on DML operations
Context:
There is a table with 2 columns
integer id column - primary key auto increment
and a long text column.
Rows are concurrently added, read and removed from this table by many different processes and connections. There are no DDL statements at…

Rcynic
- 392
- 3
- 10
2
votes
1 answer
Search list for objects valid in a time range
I have the following data structure which describes an object and the time period which it's valid. Pretend the numbers below are unix timestamps.
{
"id": 1234,
"valid_from": 2000
"valid_to": 4000
},
{
"id": 1235,
"valid_from": 1000,
…

jreid42
- 1,240
- 1
- 12
- 19
2
votes
1 answer
How to build B-tree index using Apache Spark?
Now I have a set of numbers, such as1,4,10,23,..., and I would like to build a b-tree index for them using Apache Spark. The format is per line per record (separated by '/n'). And I have also no idea of the output file's format, I just want to find…

chenzhongpu
- 6,193
- 8
- 41
- 79
2
votes
6 answers
How to name a B+Tree key/value map collection that also acts as the container for other collections
I am looking for some advice, as I am currently drawing a blank on the naming for a collection abstraction. This may be a slightly off-topic question, so apologies if that is deemed the case.
I am working on a library that provides B+Tree storage,…

Alex
- 13,024
- 33
- 62
1
vote
2 answers
How does MySQL traverse a composite B-tree index for IN() AND IN() searches
I've been studying indexes and can't completely understand how MYSQL is capable of using indexes at all for statements like
IN() AND IN() ... AND IN()
The book I am reading suggests that when we have an index (a, b, ...) but user wants to search…

Eugene
- 4,197
- 7
- 37
- 54
1
vote
1 answer
Postgres Query uses Bitmap index scan on GIN indexed item. Does not GIN use B-Tree internally?
From postgres docs on GIN -
Internally, a GIN index contains a B-tree index constructed over keys.
But in my use case, I see Bitmap indexes instead -
My Schema and Indexes are created as below.
CREATE TABLE customer (
jdata jsonb NOT NULL,
…

samshers
- 1
- 6
- 37
- 84
1
vote
1 answer
Type of primary key index and what happens on modifying them in MySQL
The highest rated answer here mentions how in MySQL records are stored in the order of primary index. Does that mean the primary index created is a sparse index? And if so, what happens if one modifies the primary key, by changing the column on…

Rinkesh P
- 588
- 4
- 13
1
vote
0 answers
Inserting in a B-tree
I need help in this one.
I'm trying to implement B-tree insertion but I got stuck in some part because I'm confused with this algorithm. Accordingly to B-tree pseudocode in the book Introduction to Algorithms of the autor Cormen, In my mind I'm…

Matheus Sousa
- 43
- 4
1
vote
0 answers
What's reason of that LIKE query didn't disable the composite Index in MySQL
Here is my table struct
CREATE TABLE t(
c1 CHAR(1) not null,
c2 CHAR(1) not null,
c3 CHAR(1) not null,
c4 CHAR(1) not null,
c5 CHAR(1) not null
)ENGINE InnoDB CHARSET UTF8;
alter table t add index c1234(c1,c2,c3,c4);
When I use explain select *…

Simon Hu
- 123
- 1
- 9
1
vote
1 answer
Bitmap index vs b-tree time complexity
Are queries on bitmap indexed fields with low distinct values faster in comparison with b-tree indices?
The common idea that bitmap indices give better query performance on fields with low distinct values in comparison with b-tree indices. But is…

agurylev
- 381
- 2
- 10
1
vote
1 answer
MySQL - BTree AND Hash indexes for the same column
I have tried finding similar questions but didn't find any, except questions regarding two indexes for the same column (in general).
Let us assume we have a table with a column COL. The table (and the entire database) is read-only for clients (let…

Mickey
- 1,405
- 2
- 13
- 33
1
vote
1 answer
Should I have index with all Where-clause fields?
I have a table, like this:
CREATE TABLE films (
title varchar(40) NOT NULL,
did integer NOT NULL,
date_prod date,
kind varchar(10)
);
I have a index, like this:
CREATE INDEX films_title_kind_idx ON films…

Max
- 1,803
- 3
- 25
- 39