aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-07-31 23:22:39 +0000
committerdrh <drh@noemail.net>2013-07-31 23:22:39 +0000
commit4bd5f73fa09a7b5c8f1fe1dd39900811d15d1dab (patch)
tree437e5440b87ac5c656f39d5ecde82dbc95761fbf /src/expr.c
parent3780be115a461f5da136079e5b9002dc70cbf25e (diff)
downloadsqlite-4bd5f73fa09a7b5c8f1fe1dd39900811d15d1dab.tar.gz
sqlite-4bd5f73fa09a7b5c8f1fe1dd39900811d15d1dab.zip
Add logic to the query planner to only use partial indices if the WHERE clause
constrains the search to rows covered by the partial index. This is just infrastructure. The key routine, sqlite3ExprImpliesExpr(), is currently a no-op so that partial indices will never be used. FossilOrigin-Name: 8ca3eac111e06a1854f878a74bffe8f20eb47f1b
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c
index 2c0419aa2..03258c32c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -3866,6 +3866,26 @@ int sqlite3ExprListCompare(ExprList *pA, ExprList *pB){
}
/*
+** Return true if we can prove the pE2 will always be true if pE1 is
+** true. Return false if we cannot complete the proof or if pE2 might
+** be false. Examples:
+**
+** pE1: x==5 pE2: x>0 Result: true
+** pE1: x>0 pE2: x==5 Result: false
+** pE1: x!=123 pE2: x IS NOT NULL Result: true
+**
+** When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has
+** Expr.iTable<0 then assume a table number given by iTab.
+**
+** When in doubt, return false. Returning true might give a performance
+** improvement. Returning false might cause a performance reduction, but
+** it will always give the correct answer and is hence always safe.
+*/
+int sqlite3ExprImpliesExpr(Expr *pE1, Expr *pE2, int iTab){
+ return 0; /* FIXME: this needs to be worked out */
+}
+
+/*
** An instance of the following structure is used by the tree walker
** to count references to table columns in the arguments of an
** aggregate function, in order to implement the