limbo/core
Jussi Saurio 482eb4aa9a Merge 'Refactor: make clear distinction between 'joined tables' and 'tables referenced from outer query scopes'' from Jussi Saurio
**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
2025-05-29 20:45:33 +03:00
..
benches change sample count to 10 2025-05-23 12:37:03 -03:00
ext Close statements in extension tests, and use mut pointers for stmt 2025-05-24 16:45:25 -04:00
functions Rename OwnedValue -> Value 2025-05-15 09:59:46 +03:00
io core: Switch Completion "is_completed" to use Cell 2025-05-27 14:05:07 +03:00
json Rename OwnedValue -> Value 2025-05-15 09:59:46 +03:00
mvcc clippy 2025-03-25 17:13:31 +02:00
numeric numeric types overhaul 2025-04-23 08:34:58 -03:00
storage remove dumb comment from pagecachekey 2025-05-29 14:12:16 +02:00
translate Fix join optimizer tests 2025-05-29 11:44:56 +03:00
vdbe Use new TableReferences struct everywhere 2025-05-29 11:44:56 +03:00
vector Rename OwnedValue -> Value 2025-05-15 09:59:46 +03:00
build.rs implement sqlite_source_id function 2025-01-28 14:55:38 -05:00
Cargo.toml tpc-h with criterion and nyrkio 2025-05-23 01:32:16 -03:00
error.rs page_cache: fix insert and evict logic 2025-05-21 14:09:39 +02:00
fast_lock.rs Reconstruct WAL frame cache when WAL is opened 2025-05-24 18:29:44 +03:00
function.rs add Func::is_deterministic() 2025-04-24 11:05:21 +03:00
info.rs implement sqlite_source_id function 2025-01-28 14:55:38 -05:00
lib.rs Use new TableReferences struct everywhere 2025-05-29 11:44:56 +03:00
numeric.rs Rename OwnedValue -> Value 2025-05-15 09:59:46 +03:00
parameters.rs Consolidate match case in parameters push to handle all anonymous params in one case 2025-05-13 14:42:12 -04:00
pseudo.rs wip 2025-03-29 22:02:49 +01:00
result.rs core: transaction support 2024-12-24 18:04:30 +01:00
schema.rs Merge 'btree: Remove assumption that all btrees have a rowid' from Jussi Saurio 2025-05-21 14:53:00 +03:00
types.rs Fix test. off by one. 2025-05-29 00:22:38 +05:30
util.rs add function parse_signed_number 2025-05-28 00:33:41 +08:00