Make all constraints a list of WhereTerms in a ProcessedWhereClause instead of separate where_clause and join_clause; gets rid of QueryConstraint in favor of just ProcessedWhereClause which is currently just a wrapper for Vec<WhereTerm>
A WhereTerm contains an AST expression plus an indication during which loop in the join the condition should be evaluated
Add more metadata to LoopInfo mainly to indicate whether that loop contains a left join and to add labels/metadata associated with that left join
Emit condition instructions in translate_table_open_loop depending on which cursor it is
In both translate_table_open_loop and translate_tables_end, emit instructions relevant to left joins if the LoopInfo in question has been marked as containing a left join
Example query:
explain select u.first_name, p.name, p2.name from users u left join products p on p.name = u.first_name join products p2 on length(p2.name) > 8 where u.first_name = 'Franklin';
Features:
Architectural changes:
where_clause
andjoin_clause
; gets rid ofQueryConstraint
in favor of justProcessedWhereClause
which is currently just a wrapper forVec<WhereTerm>
WhereTerm
contains an AST expression plus an indication during which loop in the join the condition should be evaluatedLoopInfo
mainly to indicate whether that loop contains a left join and to add labels/metadata associated with that left jointranslate_table_open_loop
depending on which cursor it istranslate_table_open_loop
andtranslate_tables_end
, emit instructions relevant to left joins if the LoopInfo in question has been marked as containing a left joinExample query:
explain select u.first_name, p.name, p2.name from users u left join products p on p.name = u.first_name join products p2 on length(p2.name) > 8 where u.first_name = 'Franklin';
Codegen (limbo):
Codegen (sqlite):