8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 07: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:19:33 +00:00
parent 17fe66cfa3
commit 006d5871b0
2 changed files with 11 additions and 3 deletions

View File

@ -5662,7 +5662,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
@ -5687,7 +5686,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

@ -3541,8 +3541,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;
@ -3558,7 +3569,6 @@ static jrd_nod* pass1(thread_db* tdbb,
}
// fall into
case nod_ansi_any:
case nod_any:
case nod_exists:
case nod_unique: