mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix the xBestIndex method of the pragma virtual table so that it correctly
gives a higher cost to plans where the schema hidden parameter is unconstrained. Fix for the problem reported by [forum:/forumpost/85b6a8b6705fb77a|forum post 85b6a8b6705fb77a]. FossilOrigin-Name: bc516ff5202ee6e9834266bf755fe26e30ac557dcc7975ca7a06dfe33874fcd2
This commit is contained in:
@@ -2885,7 +2885,11 @@ static int pragmaVtabBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
|
||||
j = seen[0]-1;
|
||||
pIdxInfo->aConstraintUsage[j].argvIndex = 1;
|
||||
pIdxInfo->aConstraintUsage[j].omit = 1;
|
||||
if( seen[1]==0 ) return SQLITE_OK;
|
||||
if( seen[1]==0 ){
|
||||
pIdxInfo->estimatedCost = (double)1000;
|
||||
pIdxInfo->estimatedRows = 1000;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
pIdxInfo->estimatedCost = (double)20;
|
||||
pIdxInfo->estimatedRows = 20;
|
||||
j = seen[1]-1;
|
||||
|
Reference in New Issue
Block a user