Index: src/where.c ================================================================== --- src/where.c +++ src/where.c @@ -3541,14 +3541,14 @@ pNew = pBuilder->pNew; whereLoopInit(pNew); /* Some pathological queries provide an unreasonable number of indexing ** options. The iPlanLimit value prevents these queries from taking up ** too much time in the planner. When iPlanLimit reaches zero, no further - ** index+constraint options are considered. Seed iPlanLimit to 10K but + ** index+constraint options are considered. Seed iPlanLimit to 20K but ** also add an extra 1K to each table of the join, to ensure that each ** table at least gets 1K opportunities. */ - pBuilder->iPlanLimit = 10000; + pBuilder->iPlanLimit = 20000; for(iTab=0, pItem=pTabList->a; pItemiTab = iTab; pBuilder->iPlanLimit += 1000; /* 1000 bonus for each table in the join */ pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor); @@ -3577,10 +3577,11 @@ } mPrior |= pNew->maskSelf; if( rc || db->mallocFailed ){ if( rc==SQLITE_DONE ){ /* We hit the query planner search limit set by iPlanLimit */ + sqlite3_log(SQLITE_WARNING, "abbreviated query algorithm search"); rc = SQLITE_OK; }else{ break; } }