mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 15:23:02 +01:00
Fixed CORE-2659: Sub-optimal (not indexed) query plan for outer joins involving complex views.
We don't need to validate all the view streams inside the optimizer, just those inside the e_derived_expr_expr argument.
This commit is contained in:
parent
e356aaeae1
commit
3a3512da8e
@ -171,32 +171,6 @@ bool OPT_computable(CompilerScratch* csb, const jrd_nod* node, SSHORT stream,
|
||||
}
|
||||
return csb->csb_rpt[n].csb_flags & csb_active;
|
||||
|
||||
case nod_derived_expr:
|
||||
{
|
||||
const UCHAR streamCount = (UCHAR)(IPTR) node->nod_arg[e_derived_expr_stream_count];
|
||||
const USHORT* streamList = (USHORT*) node->nod_arg[e_derived_expr_stream_list];
|
||||
bool active = true;
|
||||
|
||||
for (UCHAR i = 0; i < streamCount; ++i)
|
||||
{
|
||||
n = streamList[i];
|
||||
if (allowOnlyCurrentStream)
|
||||
{
|
||||
if (n != stream && !(csb->csb_rpt[n].csb_flags & csb_sub_stream))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (n == stream)
|
||||
return false;
|
||||
}
|
||||
|
||||
active = active && (csb->csb_rpt[n].csb_flags & csb_active);
|
||||
}
|
||||
|
||||
return active;
|
||||
}
|
||||
|
||||
case nod_min:
|
||||
case nod_max:
|
||||
case nod_average:
|
||||
@ -1118,23 +1092,6 @@ void OptimizerRetrieval::findDependentFromStreams(const jrd_nod* node,
|
||||
return;
|
||||
}
|
||||
|
||||
case nod_derived_expr:
|
||||
{
|
||||
const UCHAR derivedStreamCount = (UCHAR)(IPTR) node->nod_arg[e_derived_expr_stream_count];
|
||||
const USHORT* derivedStreamList = (USHORT*) node->nod_arg[e_derived_expr_stream_list];
|
||||
|
||||
for (UCHAR i = 0; i < derivedStreamCount; ++i)
|
||||
{
|
||||
const int keyStream = derivedStreamList[i];
|
||||
if (keyStream != stream && (csb->csb_rpt[keyStream].csb_flags & csb_active))
|
||||
{
|
||||
if (!streamList->exist(keyStream))
|
||||
streamList->add(keyStream);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
case nod_min:
|
||||
case nod_max:
|
||||
case nod_average:
|
||||
|
Loading…
Reference in New Issue
Block a user