Ignore not value equality property filters for ScanByPrimaryKey

This commit is contained in:
János Benjamin Antal 2023-02-06 16:39:42 +01:00
parent 4bad8c0d1e
commit b26c7d09ef
2 changed files with 3 additions and 1 deletions

View File

@ -904,7 +904,6 @@ ScanByPrimaryKey::ScanByPrimaryKey(const std::shared_ptr<LogicalOperator> &input
storage::v3::LabelId label, std::vector<query::v2::Expression *> primary_key,
storage::v3::View view)
: ScanAll(input, output_symbol, view), label_(label), primary_key_(primary_key) {
// TODO(antaljanosbenjamin): MATCH (p:Permission) WHERE p.uuid <999 RETURN p;
MG_ASSERT(primary_key.front());
}

View File

@ -597,6 +597,9 @@ class IndexLookupRewriter final : public HierarchicalLogicalOperatorVisitor {
[](const auto &schema_elem) { return schema_elem.property_id; });
for (const auto &property_filter : property_filters) {
if (property_filter.property_filter->type_ != PropertyFilter::Type::EQUAL) {
continue;
}
const auto &property_id = db_->NameToProperty(property_filter.property_filter->property_.name);
if (std::find(schema_properties.begin(), schema_properties.end(), property_id) != schema_properties.end()) {
pk_temp.emplace_back(std::make_pair(property_filter.expression, property_filter));