mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 21:23:04 +01:00
Fixed cardinality mistake for invariant booleans
This commit is contained in:
parent
01c64fe102
commit
b4a85b61a7
@ -50,9 +50,13 @@ FilteredStream::FilteredStream(CompilerScratch* csb, RecordSource* next,
|
|||||||
|
|
||||||
m_impure = csb->allocImpure<Impure>();
|
m_impure = csb->allocImpure<Impure>();
|
||||||
|
|
||||||
const auto cardinality = next->getCardinality();
|
auto cardinality = next->getCardinality();
|
||||||
|
if (selectivity)
|
||||||
|
{
|
||||||
Optimizer::adjustSelectivity(selectivity, MAXIMUM_SELECTIVITY, cardinality);
|
Optimizer::adjustSelectivity(selectivity, MAXIMUM_SELECTIVITY, cardinality);
|
||||||
m_cardinality = cardinality * selectivity;
|
cardinality *= selectivity;
|
||||||
|
}
|
||||||
|
m_cardinality = cardinality;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilteredStream::internalOpen(thread_db* tdbb) const
|
void FilteredStream::internalOpen(thread_db* tdbb) const
|
||||||
|
@ -575,7 +575,7 @@ namespace Jrd
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FilteredStream(CompilerScratch* csb, RecordSource* next,
|
FilteredStream(CompilerScratch* csb, RecordSource* next,
|
||||||
BoolExprNode* boolean, double selectivity);
|
BoolExprNode* boolean, double selectivity = 0);
|
||||||
|
|
||||||
void close(thread_db* tdbb) const override;
|
void close(thread_db* tdbb) const override;
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ namespace Jrd
|
|||||||
public:
|
public:
|
||||||
PreFilteredStream(CompilerScratch* csb, RecordSource* next,
|
PreFilteredStream(CompilerScratch* csb, RecordSource* next,
|
||||||
BoolExprNode* boolean)
|
BoolExprNode* boolean)
|
||||||
: FilteredStream(csb, next, boolean, next->getCardinality())
|
: FilteredStream(csb, next, boolean)
|
||||||
{
|
{
|
||||||
m_invariant = true;
|
m_invariant = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user