Commit Graph

4349 Commits

Author SHA1 Message Date
Pekka Enberg
87dd6075f1 Merge 'Fix the Python CI builds' from GV
Fixes the Python CI build.

Closes #363
2024-10-10 08:58:17 +03:00
gandeevanr
be94138a5a Add coverage to development dependencies in pyproject.toml and requirements-dev.txt. 2024-10-09 19:00:53 -07:00
Pekka Enberg
d6829e9794 Merge '[sorter] Hold records in Vec instead of a BTreeMap' from Arpit Saxena
We now just insert them one after the other in the vector. When rewind
is called, the vector is sorted. Iterating is just taking elements from
the vector.
Related to #191
SQLite3:
```sh
$ time sqlite3 testing/testing.db "SELECT id FROM users ORDER BY zipcode" > /dev/null

real    0m0.020s
user    0m0.013s
sys     0m0.008s
```
Limbo without this PR:
```sh
$ time target/release/limbo testing/testing.db "SELECT id FROM users ORDER BY zipcode" > /dev/null

real    0m0.285s
user    0m0.257s
sys     0m0.014s
```
Limbo with this PR:
```sh
$ time target/release/limbo testing/testing.db "SELECT id FROM users ORDER BY zipcode" > /dev/null

real    0m0.084s
user    0m0.043s
sys     0m0.032s
```

Closes #362
2024-10-09 16:32:48 +03:00
Arpit Saxena
28a603f56a [sorter] Hold records in Vec instead of a BTreeMap
We now just insert them one after the other in the vector. When rewind
is called, the vector is sorted. Iterating is just taking elements from
the vector
2024-10-09 17:58:28 +05:30
jussisaurio
556f4b73c9 Refine edge case handling: add optional predicate to get_next_record() 2024-10-08 08:23:30 +03:00
jussisaurio
43038cb6aa Handle seek() edge case with index seek 2024-10-08 07:45:21 +03:00
jussisaurio
572db69b5e Add TODO comment about index corner case 2024-10-07 17:12:19 +03:00
jussisaurio
93a8110773 dont assume index key has rowid in the second column: its the last 2024-10-07 17:05:38 +03:00
jussisaurio
8563d620af renaming 2024-10-07 17:03:50 +03:00
jussisaurio
fc71f2b32f traverse index properly
interior index cells have values that are not in the leaves, e.g.

     (interior: 3)
    /            \
(leaf: 2)     (leaf: 4)

so their values need to be emitted after the left subtree is emitted.
2024-10-07 13:04:03 +03:00
Pekka Enberg
0d673710e2 Merge 'Add instr(X,Y) scalar function' from Lauri Virtanen
Relates to issue #144
> ## instr(X,Y)
>
> The instr(X,Y) function finds the first occurrence of string Y within
string X and returns the number of prior characters plus 1, or 0 if Y is
nowhere found within X. Or, if X and Y are both BLOBs, then instr(X,Y)
returns one more than the number bytes prior to the first occurrence of
Y, or 0 if Y does not occur anywhere within X. If both arguments X and Y
to instr(X,Y) are non-NULL and are not BLOBs then both are interpreted
as strings. If either X or Y are NULL in instr(X,Y) then the result is
NULL.

Closes #357
2024-10-07 08:59:40 +03:00
jussisaurio
e5cf052f07 Why do sqlite btree child keys have <= keys and not < keys 2024-10-06 23:48:59 +03:00
Lauri Virtanen
0ae1412193 Add instr(X,Y) scalar function
Relates to issue #144
2024-10-06 20:19:37 +03:00
jussisaurio
15a66ea662 single seek function in cursor trait 2024-10-06 09:21:15 +03:00
jussisaurio
6e7db36121 reorder 2024-10-06 00:58:32 +03:00
jussisaurio
af9a751d36 Single seek function 2024-10-06 00:56:18 +03:00
jussisaurio
1ae8d28669 Use same move_to() function for tables and indexes 2024-10-06 00:51:14 +03:00
jussisaurio
37f877109e Reduce duplication in btree.rs 2024-10-06 00:39:50 +03:00
jussisaurio
bb1c8b65e8 fmt 2024-10-06 00:22:12 +03:00
jussisaurio
dde10d2dd7 Better EXPLAIN QUERY PLAN for Operator::Search 2024-10-06 00:19:56 +03:00
jussisaurio
47534cb8df Get rid of Seekrowid operator in favor of a unified Search operator 2024-10-06 00:11:38 +03:00
jussisaurio
d3e797f59e rewind_labels was renamed to scan_loop_body_labels 2024-10-05 18:27:18 +03:00
jussisaurio
d22dbe9840 remove garbage comment 2024-10-05 18:25:04 +03:00
jussisaurio
3826d4e1ff Add comment about code duplication 2024-10-05 18:25:04 +03:00
jussisaurio
d2233d69d3 Dont assume the rowid is the second column - it's the last 2024-10-05 18:25:04 +03:00
jussisaurio
db0e2ea54f Change another compat test to work around sqlite's weird choice to use the age index 2024-10-05 18:25:04 +03:00
jussisaurio
d8a695a991 rename tests 2024-10-05 18:25:04 +03:00
jussisaurio
43015f6949 Workaround for compat test 2024-10-05 18:25:04 +03:00
jussisaurio
9169f6e39b same thing 2024-10-05 18:25:04 +03:00
jussisaurio
fe90aacd35 Handle CursorResult in deferred seek 2024-10-05 18:25:04 +03:00
jussisaurio
02d6fa31d3 Fix .schema users not displaying indexes on the users table 2024-10-05 18:25:04 +03:00
jussisaurio
3a11887122 fixerinos 2024-10-05 18:25:04 +03:00
jussisaurio
ed19f47762 fix 2024-10-05 18:25:04 +03:00
jussisaurio
ff236c7781 Fix not advancing the cell index of pages 2024-10-05 18:25:04 +03:00
jussisaurio
99871bbeea yield on io 2024-10-05 18:25:04 +03:00
jussisaurio
e118b70127 fmt 2024-10-05 18:25:04 +03:00
jussisaurio
3d56fbd91c stuff 2024-10-05 18:25:04 +03:00
jussisaurio
f02da18acd index scan wip foo doesnt work yet 2024-10-05 18:25:04 +03:00
jussisaurio
d3015ad854 Merge 'Fix NextAwait's next instruction; rename rewind_labels' from Arpit Saxena
Closes #351
NextAwait's next instruction was pointing to RewindAwait earlier which
is not current. The instruction now points to the instruction after
RewindAwait, which will be the loop body. Hence, rename rewind_labels to
scan_loop_body_labels to make it clearer

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #354
2024-10-05 18:23:37 +03:00
Pekka Enberg
765870ce69 Update CHANGELOG.md 2024-10-03 10:35:56 +03:00
Pekka Enberg
fd6c27ab72 Merge 'Add randomblob(N) scalar function' from Lauri Virtanen
Relates to issue #144

Closes #355
2024-10-03 10:35:23 +03:00
Lauri Virtanen
9e80a0c4a8 Add randomblob(N) scalar function
Relates to issue #144
2024-10-03 00:05:23 +03:00
Pekka Enberg
b7656c265c Fix source formatting with cargo fmt... 2024-10-02 11:06:38 +03:00
Pekka Enberg
6fcd818160 Merge 'Add unhex(X) scalar function' from Lauri Virtanen
This commit adds `unhex(X)` scalar function. Function with `unhex(X,Y)`
two arguments is not implemented yet.
Relates to issue #144

Closes #353
2024-10-02 11:01:15 +03:00
Pekka Enberg
b2fd509ecc Merge 'Add zeroblob(N) scalar function' from Lauri Virtanen
Relates to issue #144

Closes #352
2024-10-02 10:59:22 +03:00
Arpit Saxena
47c8fd1964 Fix NextAwait's next instruction; rename rewind_labels
Closes #351

NextAwait's next instruction was pointing to RewindAwait earlier which
is not current. The instruction now points to the instruction after
RewindAwait, which will be the loop body. Hence, rename rewind_labels to
scan_loop_body_labels to make it clearer
2024-10-02 11:58:42 +05:30
Lauri Virtanen
adc6f9b6cd Add unhex(X) scalar function
This commit adds `unhex(X)` scalar function. Function with `unhex(X,Y)`
two arguments is not implemented yet.

Relates to issue #144
2024-09-30 00:13:43 +03:00
Lauri Virtanen
f612ead8a3 Add zeroblob(N) scalar function
Relates to issue #144
2024-09-29 23:39:53 +03:00
Pekka Enberg
b8dffbf7f9 Merge 'Maintain pending io_uring ops count for early return on run_once' from Arpit Saxena
Add a `pending_ops` field to `InnerLinuxIO` struct which is incremented
for each operation submitted to the ring and decremented when they are
taken off the completion queue. With this, we can exit from run_once if
there are no pending operations. Otherwise, in that case, it would hang
indefinitely due to call of `ring.submit_and_wait(1)`

Closes #349
2024-09-27 12:22:51 -07:00
Arpit Saxena
b7debabd81 Wrap IoUring to ensure pending_ops is always correctly updated
Adds a struct WrappedIOUring which contains a IoUring and a pending_ops
field. Entry submission and popping from the queue is done through
functions operating on it, which also maintains pending_ops count

NOTE: This is a bit weird/hacky since in get_completion we create a
CompletionQueue and just call its next(). If it were a normal iterator
it would always return the same first item. However it is a queue posing
as an iterator which makes this work.
2024-09-28 00:10:05 +05:30