Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRIMARY KEY auto-index is not populated during insert #918

Open
sivukhin opened this issue Feb 7, 2025 · 1 comment
Open

PRIMARY KEY auto-index is not populated during insert #918

sivukhin opened this issue Feb 7, 2025 · 1 comment

Comments

@sivukhin
Copy link
Contributor

sivukhin commented Feb 7, 2025

PRIMARY KEY auto-index now always empty in Limbo:

limbo> CREATE TABLE users (id PRIMARY KEY, username TEXT);
limbo> INSERT INTO users VALUES (1, 'alice');
limbo> SELECT * FROM users WHERE id = 1;
#[nothing here]

The problem is that during INSERT planner completely ignore auto-index:

limbo> EXPLAIN INSERT INTO users VALUES (1, 'alice');
addr  opcode             p1    p2    p3    p4             p5  comment
----  -----------------  ----  ----  ----  -------------  --  -------
0     Init               0     10    0                    0   Start at 10
1     OpenWriteAsync     0     2     0                    0   
2     OpenWriteAwait     0     0     0                    0   
3     Integer            1     2     0                    0   r[2]=1
4     String8            0     3     0     alice          0   r[3]='alice'
5     NewRowId           0     1     0                    0   
6     MakeRecord         2     2     4                    0   r[4]=mkrec(r[2..3])
7     InsertAsync        0     4     1                    0   
8     InsertAwait        0     0     0                    0   
9     Halt               0     0     0                    0   
10    Transaction        0     1     0                    0   
11    Goto               0     1     0                    0   

@jussisaurio
Copy link
Collaborator

jussisaurio commented Feb 8, 2025

we don't have any index insertions yet :)

i made this ages ago but didnt pursue merging it because it needed a proper tree balancing to work correctly for any non trivial inputs

#665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants