Files
turso/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
..
2025-05-23 12:37:03 -03:00
2025-05-15 09:59:46 +03:00
2025-05-15 09:59:46 +03:00
2025-03-25 17:13:31 +02:00
2025-04-23 08:34:58 -03:00
2025-05-29 11:44:56 +03:00
2025-05-15 09:59:46 +03:00
2025-01-28 14:55:38 -05:00
2025-05-23 01:32:16 -03:00
2025-04-24 11:05:21 +03:00
2025-01-28 14:55:38 -05:00
2025-05-15 09:59:46 +03:00
wip
2025-03-29 22:02:49 +01:00
2024-12-24 18:04:30 +01:00
2025-05-29 00:22:38 +05:30
2025-05-28 00:33:41 +08:00