Nikita Sivukhin
a4a80f37bc
rewrite unary expressions too - in order to support "NOT FALSE" expressions
2025-02-03 11:25:14 +04:00
Pekka Enberg
662d629666
Rename JoinAwareConditionExpr to WhereTerm
...
We transform all JOIN conditions into WHERE clause terms in the query
planner. The JoinAwareConditionExpr name tries to make that point, but I
think it makes things more confusing. Let's call it WhereTerm (suggested
by Jussi).
2025-02-03 07:46:51 +02:00
Jussi Saurio
98439cd936
optimizer.rs: refactor to use new data structures and remove unnecessary stuff
...
We don't need `push_predicates()` because that never REALLY was a predicate
pushdown optimization -- it just pushed WHERE clause condition expressions
into the correct SourceOperator nodes in the tree.
Now that we don't have a SourceOperator tree anymore and we keep the conditions
in the WHERE clause instead, we don't need to "push" anything anymore. Leaves
room for ACTUAL predicate pushdown optimizations later :)
We also don't need any weird bitmask stuff anymore, and perhaps we never did,
to determine where conditions should be evaluated.
2025-02-02 10:18:13 +02:00
Jussi Saurio
1bcdf99eab
core/optimizer: do expression rewriting on all expressions
2025-01-10 10:04:07 +02:00
Jussi Saurio
925bd62cbc
fix logic bug in check_index_scan() that swapped lhs/rhs but not the comparison op
2025-01-08 08:20:13 +02:00
Jussi Saurio
4a58898863
Rename eliminate_between to rewrite_exprs and add true/false->1/0 case there
2025-01-08 08:20:13 +02:00
Jussi Saurio
1b61749c0f
feat/core/translate: create automatic index in CREATE TABLE when necessary
2025-01-04 13:54:44 +02:00
Jussi Saurio
80b9da95c0
replace termination_label_stack with much simpler LoopLabels
2025-01-01 07:56:39 +02:00
Jussi Saurio
2066475e03
feat: subqueries in FROM clause
2024-12-31 14:18:29 +02:00
Lauri Virtanen
854005b977
Run cargo clippy --fix && cargo fmt
2024-12-29 19:22:28 +02:00
PThorpe92
f6cd707544
Add clippy CI, fix or ignore warnings where appropriate
2024-12-29 10:25:41 -05:00
adamnemecek
97647ff056
Clean up code to use Self
...
Closes #556
2024-12-29 10:07:38 +02:00
김선우
5cdcb8d78c
Split Plan into Select and Delete
2024-12-23 05:45:23 +09:00
김선우
82c127b7a3
Remove bool args in optimize_plan
2024-12-23 04:47:05 +09:00
김선우
1d3ce52812
Refactor planner and optimizer to be DRY
2024-12-22 15:11:26 +09:00
김선우
9a8b94ef93
First successful implementation of delete planning
2024-12-22 13:16:16 +09:00
jussisaurio
82bc9501fd
Merge 'feat(optimizer): eliminate between statement' from KaguraMilet
...
Rewrite `Y BETWEEN X AND Z` as `X <= Y AND Y <= Z`. And due to the
support of this optimization rule, limbo should now be able to execute
the `BETWEEN AND` statement.
Closes #490
2024-12-20 17:23:42 +02:00
KaguraMilet
ef39f11a9f
fix(optimizer): process Parenthesized expression
2024-12-20 23:11:17 +08:00
KaguraMilet
1df3189db6
feat(optimizer): support NOT BETWEEN AND with De Morgan's Laws.
2024-12-16 23:28:54 +08:00
KaguraMilet
da781dffa0
feat(optimizer): eliminate between statement
2024-12-16 20:34:25 +08:00
jussisaurio
a04cf611e0
fix bug with making an index search node in a self join where expr refers to other instance of same table
2024-12-14 17:11:32 +02:00
jussisaurio
961e57df94
Fix returning rowid instead of PK when PK is not a rowid alias
2024-12-14 15:51:08 +02:00
jussisaurio
5e9e2dffe9
support TRUE and FALSE in predicates
2024-12-13 22:58:29 +02:00
jussisaurio
fe88d45e5e
Add more comments to push_predicate/push_predicates
2024-12-09 17:50:29 +02:00
jussisaurio
52beeabd45
tweaks
2024-11-26 17:31:51 +02:00
jussisaurio
d2f84edd2e
fix accidentally removing push_scan_direction()
2024-11-26 17:31:51 +02:00
jussisaurio
7ecc252507
fix rest of the failing tests
2024-11-26 17:31:51 +02:00
jussisaurio
cc902ed25d
GROUP BY and ORDER BY mostly work
2024-11-26 17:31:51 +02:00
jussisaurio
3f9e60633f
select refactor: order by and basic agg kinda work
2024-11-26 17:31:51 +02:00
jussisaurio
d0466e1cae
introduce Column member of ast::Expr and bind idents to columns
2024-11-26 17:31:51 +02:00
limeng.1
1cb1d16c08
resolve comments
2024-11-19 11:39:08 +08:00
limeng.1
8cca659052
impl order by desc
2024-11-19 11:39:07 +08:00
jussisaurio
daf5863932
manual fixes based on clippy suggestions
2024-10-13 12:19:04 +03:00
jussisaurio
f634e7f7a3
clippy fix
2024-10-13 12:08:54 +03:00
jussisaurio
b3c57d5691
core/translate: (refactor) use btreetablereference struct instead of tuple
2024-10-13 11:25:33 +03:00
jussisaurio
04ecbff7fc
Eliminate unnecessary ORDER BY if result set is already ordered
2024-10-10 23:43:39 +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
d22dbe9840
remove garbage comment
2024-10-05 18:25:04 +03:00
jussisaurio
3a11887122
fixerinos
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
김선우
28884181be
Fix clippy
2024-09-15 16:23:27 +09:00
jussisaurio
b6e88ca883
cargo clippy --fix --allow-dirty && cargo fmt
2024-09-15 09:35:39 +03:00
jussisaurio
a108dea825
GROUP BY
2024-09-14 16:14:45 +03:00
jussisaurio
d1059da9f1
Return enum instead of bool for better documentation
2024-08-25 11:15:47 +03:00
jussisaurio
d653f550e2
Don't do any I/O if top level operator is Nothing
2024-08-25 10:43:52 +03:00
jussisaurio
e8c894e532
More flexible Emitter via stateful operators
2024-08-17 12:55:16 +03:00
jussisaurio
069826820e
Finish renaming node -> operator
2024-08-16 19:42:03 +03:00
jussisaurio
2e32ca0bdb
More structured query planner
2024-08-16 19:42:03 +03:00