mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 15:23:03 +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>();
|
||||
|
||||
const auto cardinality = next->getCardinality();
|
||||
Optimizer::adjustSelectivity(selectivity, MAXIMUM_SELECTIVITY, cardinality);
|
||||
m_cardinality = cardinality * selectivity;
|
||||
auto cardinality = next->getCardinality();
|
||||
if (selectivity)
|
||||
{
|
||||
Optimizer::adjustSelectivity(selectivity, MAXIMUM_SELECTIVITY, cardinality);
|
||||
cardinality *= selectivity;
|
||||
}
|
||||
m_cardinality = cardinality;
|
||||
}
|
||||
|
||||
void FilteredStream::internalOpen(thread_db* tdbb) const
|
||||
|
@ -575,7 +575,7 @@ namespace Jrd
|
||||
{
|
||||
public:
|
||||
FilteredStream(CompilerScratch* csb, RecordSource* next,
|
||||
BoolExprNode* boolean, double selectivity);
|
||||
BoolExprNode* boolean, double selectivity = 0);
|
||||
|
||||
void close(thread_db* tdbb) const override;
|
||||
|
||||
@ -623,7 +623,7 @@ namespace Jrd
|
||||
public:
|
||||
PreFilteredStream(CompilerScratch* csb, RecordSource* next,
|
||||
BoolExprNode* boolean)
|
||||
: FilteredStream(csb, next, boolean, next->getCardinality())
|
||||
: FilteredStream(csb, next, boolean)
|
||||
{
|
||||
m_invariant = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user