Lines Matching refs:nOrderBy
719 for(i=0; i<p->nOrderBy; i++){ in whereTraceIndexInfoInputs()
1182 int nOrderBy; in allocateIndexInfo() local
1226 nOrderBy = 0; in allocateIndexInfo()
1268 nOrderBy = n; in allocateIndexInfo()
1281 + sizeof(*pIdxOrderBy)*nOrderBy + sizeof(*pHidden) in allocateIndexInfo()
1290 pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy]; in allocateIndexInfo()
1344 for(i=j=0; i<nOrderBy; i++){ in allocateIndexInfo()
1354 pIdxInfo->nOrderBy = j; in allocateIndexInfo()
3825 pIdxInfo->nOrderBy : 0); in whereLoopAddVirtualOne()
4372 u16 nOrderBy; /* Number terms in the ORDER BY clause */ in wherePathSatisfiesOrderBy() local
4413 nOrderBy = pOrderBy->nExpr; in wherePathSatisfiesOrderBy()
4414 testcase( nOrderBy==BMS-1 ); in wherePathSatisfiesOrderBy()
4415 if( nOrderBy>BMS-1 ) return 0; /* Cannot optimize overly large ORDER BYs */ in wherePathSatisfiesOrderBy()
4417 obDone = MASKBIT(nOrderBy)-1; in wherePathSatisfiesOrderBy()
4449 for(i=0; i<nOrderBy; i++){ in wherePathSatisfiesOrderBy()
4582 for(i=0; bOnce && i<nOrderBy; i++){ in wherePathSatisfiesOrderBy()
4655 for(i=0; i<nOrderBy; i++){ in wherePathSatisfiesOrderBy()
4668 if( obSat==obDone ) return (i8)nOrderBy; in wherePathSatisfiesOrderBy()
4670 for(i=nOrderBy-1; i>0; i--){ in wherePathSatisfiesOrderBy()
4729 int nOrderBy, in whereSortingCost() argument
4747 assert( nOrderBy>0 && 66==sqlite3LogEst(100) ); in whereSortingCost()
4748 rScale = sqlite3LogEst((nOrderBy-nSorted)*100/nOrderBy) - 66; in whereSortingCost()
4786 int nOrderBy; /* Number of ORDER BY clause terms */ in wherePathSolver() local
4815 nOrderBy = 0; in wherePathSolver()
4817 nOrderBy = pWInfo->pOrderBy->nExpr; in wherePathSolver()
4822 nSpace += sizeof(LogEst) * nOrderBy; in wherePathSolver()
4832 if( nOrderBy ){ in wherePathSolver()
4840 memset(aSortCost, 0, sizeof(LogEst) * nOrderBy); in wherePathSolver()
4842 assert( aSortCost==0 || &pSpace[nSpace]==(char*)&aSortCost[nOrderBy] ); in wherePathSolver()
4853 if( nOrderBy ){ in wherePathSolver()
4860 aFrom[0].isOrdered = nLoop>0 ? -1 : nOrderBy; in wherePathSolver()
4903 if( isOrdered>=0 && isOrdered<nOrderBy ){ in wherePathSolver()
4906 pWInfo, nRowEst, nOrderBy, isOrdered in wherePathSolver()
4917 aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, in wherePathSolver()