mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Extra steps taken to avoid using low-quality indexes in a query plan.
This branch accomplishes the same end as the nearby enhanced-stat1 branch, but with much less change and hence less risk. FossilOrigin-Name: c030e646262fee43a59b45fdc1630d972f8bf88ac3c142b6bdaf4cbb36695a4f
This commit is contained in:
@@ -1556,6 +1556,16 @@ static void decodeIntArray(
|
||||
while( z[0]!=0 && z[0]!=' ' ) z++;
|
||||
while( z[0]==' ' ) z++;
|
||||
}
|
||||
|
||||
/* Set the bLowQual flag if the peak number of rows obtained
|
||||
** from a full equality match is so large that a full table scan
|
||||
** seems likely to be faster than using the index.
|
||||
*/
|
||||
if( aLog[0] > 66 /* Index has more than 100 rows */
|
||||
&& aLog[0] <= aLog[nOut-1] /* And only a single value seen */
|
||||
){
|
||||
pIndex->bLowQual = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user