aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/where.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/where.c b/src/where.c
index a90f8c740..dbb1f3f39 100644
--- a/src/where.c
+++ b/src/where.c
@@ -1695,7 +1695,8 @@ static void bestAutomaticIndex(
}
assert( pParse->nQueryLoop >= (double)1 );
- nTableRow = pSrc->pIndex ? pSrc->pIndex->aiRowEst[0] : 1000000;
+ pTable = pSrc->pTab;
+ nTableRow = pTable->pIndex ? pTable->pIndex->aiRowEst[0] : 1000000;
logN = estLog(nTableRow);
costTempIdx = 2*logN*(nTableRow/pParse->nQueryLoop + 1);
if( costTempIdx>=pCost->rCost ){
@@ -1705,7 +1706,6 @@ static void bestAutomaticIndex(
}
/* Search for any equality comparison term */
- pTable = pSrc->pTab;
pWCEnd = &pWC->a[pWC->nTerm];
for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
if( termCanDriveIndex(pTerm, pSrc, notReady) ){