8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 23:23:04 +01:00

Restored my previous solution. The final decision is that NOT IN cannot be index-optimized reliably.

This commit is contained in:
dimitr 2006-05-24 13:15:01 +00:00
parent 64a14ef75a
commit 6b77b151a8
3 changed files with 11 additions and 8 deletions

View File

@ -5645,7 +5645,6 @@ static dsql_nod* pass1_not(dsql_req* request,
case nod_geq_all:
node_type = nod_lss_any;
break;
/*
case nod_eql_any:
if (sub->nod_arg[1]->nod_type == nod_list) {
// this is NOT IN (<list>), don't change it
@ -5670,7 +5669,6 @@ static dsql_nod* pass1_not(dsql_req* request,
case nod_geq_any:
node_type = nod_lss_all;
break;
*/
case nod_between:
node_type = nod_or;
is_between = true;

View File

@ -3501,8 +3501,19 @@ static jrd_nod* pass1(thread_db* tdbb,
validate_expr);
break;
case nod_not:
sub = node->nod_arg[0];
if (sub->nod_type == nod_ansi_any)
sub->nod_flags |= nod_deoptimize;
break;
case nod_ansi_all:
node->nod_flags |= nod_deoptimize;
// fall into
case nod_ansi_any:
if (node->nod_flags & nod_deoptimize)
{
node->nod_flags &= ~nod_deoptimize;
// Deoptimize the conjunct, not the ALL node itself
jrd_nod* boolean =
((RecordSelExpr*) (node->nod_arg[e_any_rse]))->rse_boolean;
@ -3518,7 +3529,6 @@ static jrd_nod* pass1(thread_db* tdbb,
}
// fall into
case nod_ansi_any:
case nod_any:
case nod_exists:
case nod_unique:

View File

@ -1950,11 +1950,6 @@ static bool get_record(thread_db* tdbb,
{
select_node = NULL;
}
EVL_expr(tdbb, column_node->nod_arg[0]);
if (request->req_flags & req_null) {
return false;
}
}
if (column_node && (request->req_flags & req_ansi_any))
{