aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-06-24 16:03:18 +0000
committerdrh <drh@noemail.net>2017-06-24 16:03:18 +0000
commit54ac445d53512b3215ed41f8594815a46f9005cc (patch)
treeaa0fbf40eee2c365cb9ee5c5c971beccd1c5c903 /src
parent45e7d7dd1c50a99a1a9b989ece56e4b7533b386e (diff)
downloadsqlite-54ac445d53512b3215ed41f8594815a46f9005cc.tar.gz
sqlite-54ac445d53512b3215ed41f8594815a46f9005cc.zip
Query planner tuning: When deciding between two plans with the same cost,
bias the selection toward the one that does not use the sorter. FossilOrigin-Name: f0ec36d479ac4efaa0efd0594d032dd7b8ccdf84a4dc3644cd688762186fbcca
Diffstat (limited to 'src')
-rw-r--r--src/where.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/where.c b/src/where.c
index 1cd5d7033..41bcb3031 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3972,6 +3972,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
rUnsorted, rCost));
}else{
rCost = rUnsorted;
+ rUnsorted -= 2; /* TUNING: Slight bias in favor of no-sort plans */
}
/* Check to see if pWLoop should be added to the set of