diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index 3a4a88168..8dcfb84b8 100644 --- a/src/select.c +++ b/src/select.c @@ -4239,11 +4239,13 @@ int sqlite3Select( ** and pKeyInfo to the KeyInfo structure required to navigate the ** index. ** + ** (2011-04-15) Do not do a full scan of an unordered index. + ** ** In practice the KeyInfo structure will not be used. It is only ** passed to keep OP_OpenRead happy. */ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - if( !pBest || pIdx->nColumn<pBest->nColumn ){ + if( pIdx->bUnordered==0 && (!pBest || pIdx->nColumn<pBest->nColumn) ){ pBest = pIdx; } } |