@@ -126,7 +126,7 @@ namespace {
126
126
127
127
TString attributeName;
128
128
129
- if (IsAttribute (right, attributeName) && IsConstantExpr (left.Ptr ())) {
129
+ if (IsAttribute (right, attributeName) && IsConstantExprWithParams (left.Ptr ())) {
130
130
std::swap (left, right);
131
131
}
132
132
@@ -139,8 +139,8 @@ namespace {
139
139
// In case the right side is a constant that can be extracted, compute the selectivity using statistics
140
140
// Currently, with the basic statistics we just return 1/nRows
141
141
142
- else if (IsConstantExpr (right.Ptr ())) {
143
- if (stats->ColumnStatistics == nullptr ) {
142
+ else if (IsConstantExprWithParams (right.Ptr ())) {
143
+ if (! IsConstantExpr (right. Ptr ()) || stats->ColumnStatistics == nullptr ) {
144
144
return DefaultSelectivity (stats, attributeName);
145
145
}
146
146
@@ -165,7 +165,7 @@ namespace {
165
165
Y_UNUSED (stats);
166
166
167
167
TString attributeName;
168
- if (IsAttribute (right, attributeName) && IsConstantExpr (left.Ptr ())) {
168
+ if (IsAttribute (right, attributeName) && IsConstantExprWithParams (left.Ptr ())) {
169
169
std::swap (left, right);
170
170
}
171
171
@@ -176,7 +176,7 @@ namespace {
176
176
}
177
177
// In case the right side is a constant that can be extracted, compute the selectivity using statistics
178
178
// Currently, with the basic statistics we just return 0.5
179
- else if (IsConstantExpr (right.Ptr ())) {
179
+ else if (IsConstantExprWithParams (right.Ptr ())) {
180
180
return 0.5 ;
181
181
}
182
182
}
0 commit comments