MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / applyBoolean

Method applyBoolean

src/jrd/optimizer/Optimizer.cpp:1753–1774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751//
1752
1753RecordSource* Optimizer::applyBoolean(RecordSource* rsb,
1754 ConjunctIterator& iter)
1755{
1756 BoolExprNode* boolean = nullptr;
1757 double selectivity = MAXIMUM_SELECTIVITY;
1758
1759 for (iter.rewind(); iter.hasData(); ++iter)
1760 {
1761 if (!(iter & CONJUNCT_USED) &&
1762 !(iter->nodFlags & ExprNode::FLAG_RESIDUAL) &&
1763 iter->computable(csb, INVALID_STREAM, false))
1764 {
1765 compose(getPool(), &boolean, iter);
1766 iter |= CONJUNCT_USED;
1767
1768 if (!(iter & (CONJUNCT_MATCHED | CONJUNCT_JOINED)))
1769 selectivity *= getSelectivity(*iter);
1770 }
1771 }
1772
1773 return boolean ? FB_NEW_POOL(getPool()) FilteredStream(csb, rsb, boolean, selectivity) : rsb;
1774}
1775
1776
1777//

Callers 1

CrossJoinMethod · 0.80

Calls 5

composeFunction · 0.85
FilteredStreamClass · 0.85
rewindMethod · 0.45
hasDataMethod · 0.45
computableMethod · 0.45

Tested by

no test coverage detected