aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c7
-rw-r--r--src/where.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/select.c b/src/select.c
index ee994a8c2..8972faacc 100644
--- a/src/select.c
+++ b/src/select.c
@@ -3884,11 +3884,10 @@ static void explainSimpleCount(
Index *pIdx /* Index used to optimize scan, or NULL */
){
if( pParse->explain==2 ){
- char *zEqp = sqlite3MPrintf(pParse->db, "SCAN TABLE %s %s%s(~%d rows)",
+ char *zEqp = sqlite3MPrintf(pParse->db, "SCAN TABLE %s%s%s",
pTab->zName,
- pIdx ? "USING COVERING INDEX " : "",
- pIdx ? pIdx->zName : "",
- pTab->nRowEst
+ pIdx ? " USING COVERING INDEX " : "",
+ pIdx ? pIdx->zName : ""
);
sqlite3VdbeAddOp4(
pParse->pVdbe, OP_Explain, pParse->iSelectId, 0, 0, zEqp, P4_DYNAMIC
diff --git a/src/where.c b/src/where.c
index 4a27b9e38..330faf771 100644
--- a/src/where.c
+++ b/src/where.c
@@ -4308,7 +4308,7 @@ static int whereLoopAddBtreeIndex(
}else{
/* Each row involves a step of the index, then a binary search of
** the main table */
- WhereCost rStepAndSearch = rLogSize>80 ? rLogSize-80 : 1;
+ WhereCost rStepAndSearch = whereCostAdd(10, rLogSize>17 ? rLogSize-17 : 1);
pNew->rRun = whereCostAdd(pNew->rRun, rStepAndSearch);
}
/* TBD: Adjust nOut for additional constraints */