summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/optimizer/partial_schema_requirements.h
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2023-03-14 16:00:26 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-30 21:53:55 +0000
commit187851fdfda231e63a13b1189a8f8566c57e701a (patch)
tree856363f5466fd8167a2af8262b02f1b82122dbd6 /src/mongo/db/query/optimizer/partial_schema_requirements.h
parent6afa8dd2bb3435e3632375a545d8a2c76a1cd620 (diff)
downloadmongo-187851fdfda231e63a13b1189a8f8566c57e701a.tar.gz
SERVER-74539 Enable disjunction in PSR conversion
Diffstat (limited to 'src/mongo/db/query/optimizer/partial_schema_requirements.h')
-rw-r--r--src/mongo/db/query/optimizer/partial_schema_requirements.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/mongo/db/query/optimizer/partial_schema_requirements.h b/src/mongo/db/query/optimizer/partial_schema_requirements.h
index fb84db887fd..47feba141e8 100644
--- a/src/mongo/db/query/optimizer/partial_schema_requirements.h
+++ b/src/mongo/db/query/optimizer/partial_schema_requirements.h
@@ -123,11 +123,6 @@ public:
PartialSchemaRequirements(PSRExpr::Node requirements);
- // TODO SERVER-74539: remove these contructors.
- PartialSchemaRequirements(std::vector<Entry>);
- PartialSchemaRequirements(std::initializer_list<Entry> entries)
- : PartialSchemaRequirements(std::vector<Entry>(entries)) {}
-
bool operator==(const PartialSchemaRequirements& other) const;
/**
@@ -137,17 +132,6 @@ public:
bool isNoop() const;
/**
- * Return the number of PartialSchemaEntries.
- */
- size_t numLeaves() const;
-
- /**
- * Return the number of Disjunctions under a top-level Conjunction.
- * TODO SERVER-69026 Remove or clarify this method.
- */
- size_t numConjuncts() const;
-
- /**
* Return the bound projection name corresponding to the first conjunct matching the given key.
* Assert on non-DNF requirements.
*/
@@ -187,8 +171,14 @@ public:
}
/**
- * Add an entry to the first AND under a top-level OR. Asserts on non-DNF requirements.
- * TODO SERVER-74539, remove or clarify this method.
+ * Conjunctively combine 'this' with another PartialSchemaRequirement.
+ * Asserts that 'this' is in DNF.
+ *
+ * For now, we assert that we have only one disjunct. This means we avoid applying
+ * the distributive law, which would duplicate the new requirement into each disjunct.
+ *
+ * TODO SERVER-69026 Consider applying the distributive law to allow contained-OR in
+ * SargableNode.
*/
void add(PartialSchemaKey, PartialSchemaRequirement);