1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Do not do full table scans of unordered indices.

FossilOrigin-Name: a8761a9128de945aa4b6196df5ffe64115d66b61
This commit is contained in:
drh
2011-04-15 14:46:27 +00:00
parent d4a80312b8
commit 3e9548b30d
4 changed files with 14 additions and 9 deletions

View File

@@ -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;
}
}