summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/README
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-08-10 02:26:40 +0000
committerBruce Momjian <bruce@momjian.us>1998-08-10 02:26:40 +0000
commit2d32d909b559d7cc13cbcd09967c84277d9eeced (patch)
tree20c37a384bca308a09c55d9a1260cc3b2adff3cb /src/backend/optimizer/README
parentaddddea3138fed417f690926ac1f95e80b36d291 (diff)
downloadpostgresql-2d32d909b559d7cc13cbcd09967c84277d9eeced.tar.gz
Cleanup optimizer function names and clarify code.
Diffstat (limited to 'src/backend/optimizer/README')
-rw-r--r--src/backend/optimizer/README25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/backend/optimizer/README b/src/backend/optimizer/README
index 98639181d4..8e9684c6d9 100644
--- a/src/backend/optimizer/README
+++ b/src/backend/optimizer/README
@@ -9,13 +9,36 @@ planner()
preprocess target list
preprocess qualifications(WHERE)
--query_planner()
- cnfify qualification, so qual are expressions (were AND's) and OR clauses
+ cnfify()
+ Summary:
+
+ Simple cases with all AND's are handled by removing the AND's:
+
+ convert: a = 1 AND b = 2 AND c = 3
+ to: a = 1, b = 2, c = 3
+
+ Qualifications with OR's are handled differently. OR's inside AND
+ clauses are not modified drastically:
+
+ convert: a = 1 AND b = 2 AND (c = 3 OR d = 4)
+ to: a = 1, b = 2, c = 3 OR d = 4
+
+ OR's in the upper level are more complex to handle:
+
+ convert: (a = 1 AND b = 2) OR c = 3
+ to: (a = 1 OR c = 3) AND (b = 2 OR c = 3)
+ finally: (a = 1 OR c = 3), (b = 2 OR c = 3)
+
+ These clauses all have to be true for a result to be returned,
+ so the optimizer can choose the most restrictive clauses.
+
pull out constants from target list
get a target list that only contains column names, no expressions
if none, then return
---subplanner()
make list of relations in target
make list of relations in where clause
+ split up the qual into restrictions (a=1) and joins (b=c)
find which relations can do merge sort and hash joins
----find_paths()
find scan and all index paths for each relation not yet joined