mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-07-07 20:45:01 +00:00
![]() **Beef:** we need to distinguish between references to tables in the current query scope (CTEs, FROM clause) and references to tables from outer query scopes (inside subqueries, or inside CTEs that refer to previous CTEs). We don't want to consider 'tables from outside' in the join order of a subquery, but we want the subquery to be able to _reference_ those tables in e.g. its WHERE clause. This PR -- or at least some sort of equivalent of it -- is a requirement for #1595. --- This PR replaces the `Vec<TableReference>` we use with new data structures: - TableReferences struct, which holds both: - joined_tables, and - outer_query_refs - JoinedTable: - this is just a rename of the previous TableReference struct - OuterQueryReference - this is to distinguish from JoinedTable those cases where e.g. a subquery refers to an outer query's table, or a CTE refers to a previous CTE. Both JoinedTable and OuterQueryReference can be referred to by expressions, but only JoinedTables are considered for join ordering optimization and so forth. These data structures are then used everywhere, which resulted in a lot of changes. Reviewed-by: Pere Diaz Bou <pere-altea@homail.com> Closes #1580 |
||
---|---|---|
.. | ||
benches | ||
ext | ||
functions | ||
io | ||
json | ||
mvcc | ||
numeric | ||
storage | ||
translate | ||
vdbe | ||
vector | ||
build.rs | ||
Cargo.toml | ||
error.rs | ||
fast_lock.rs | ||
function.rs | ||
info.rs | ||
lib.rs | ||
numeric.rs | ||
parameters.rs | ||
pseudo.rs | ||
result.rs | ||
schema.rs | ||
types.rs | ||
util.rs |