亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? where.c

?? 新版輕量級嵌入式數(shù)據(jù)庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
    exprAnalyze(pSrc, pMaskSet, pWC, idxNew1);    pNewExpr2 = sqlite3Expr(TK_LT, sqlite3ExprDup(pLeft), pStr2, 0);    idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC);    exprAnalyze(pSrc, pMaskSet, pWC, idxNew2);    pTerm = &pWC->a[idxTerm];    if( isComplete ){      pWC->a[idxNew1].iParent = idxTerm;      pWC->a[idxNew2].iParent = idxTerm;      pTerm->nChild = 2;    }  }#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */}/*** This routine decides if pIdx can be used to satisfy the ORDER BY** clause.  If it can, it returns 1.  If pIdx cannot satisfy the** ORDER BY clause, this routine returns 0.**** pOrderBy is an ORDER BY clause from a SELECT statement.  pTab is the** left-most table in the FROM clause of that same SELECT statement and** the table has a cursor number of "base".  pIdx is an index on pTab.**** nEqCol is the number of columns of pIdx that are used as equality** constraints.  Any of these columns may be missing from the ORDER BY** clause and the match can still be a success.**** All terms of the ORDER BY that match against the index must be either** ASC or DESC.  (Terms of the ORDER BY clause past the end of a UNIQUE** index do not need to satisfy this constraint.)  The *pbRev value is** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if** the ORDER BY clause is all ASC.*/static int isSortingIndex(  Parse *pParse,          /* Parsing context */  Index *pIdx,            /* The index we are testing */  int base,               /* Cursor number for the table to be sorted */  ExprList *pOrderBy,     /* The ORDER BY clause */  int nEqCol,             /* Number of index columns with == constraints */  int *pbRev              /* Set to 1 if ORDER BY is DESC */){  int i, j;                       /* Loop counters */  int sortOrder = 0;              /* XOR of index and ORDER BY sort direction */  int nTerm;                      /* Number of ORDER BY terms */  struct ExprList_item *pTerm;    /* A term of the ORDER BY clause */  sqlite3 *db = pParse->db;  assert( pOrderBy!=0 );  nTerm = pOrderBy->nExpr;  assert( nTerm>0 );  /* Match terms of the ORDER BY clause against columns of  ** the index.  */  for(i=j=0, pTerm=pOrderBy->a; j<nTerm && i<pIdx->nColumn; i++){    Expr *pExpr;       /* The expression of the ORDER BY pTerm */    CollSeq *pColl;    /* The collating sequence of pExpr */    int termSortOrder; /* Sort order for this term */    pExpr = pTerm->pExpr;    if( pExpr->op!=TK_COLUMN || pExpr->iTable!=base ){      /* Can not use an index sort on anything that is not a column in the      ** left-most table of the FROM clause */      return 0;    }    pColl = sqlite3ExprCollSeq(pParse, pExpr);    if( !pColl ) pColl = db->pDfltColl;    if( pExpr->iColumn!=pIdx->aiColumn[i] ||         sqlite3StrICmp(pColl->zName, pIdx->azColl[i]) ){      /* Term j of the ORDER BY clause does not match column i of the index */      if( i<nEqCol ){        /* If an index column that is constrained by == fails to match an        ** ORDER BY term, that is OK.  Just ignore that column of the index        */        continue;      }else{        /* If an index column fails to match and is not constrained by ==        ** then the index cannot satisfy the ORDER BY constraint.        */        return 0;      }    }    assert( pIdx->aSortOrder!=0 );    assert( pTerm->sortOrder==0 || pTerm->sortOrder==1 );    assert( pIdx->aSortOrder[i]==0 || pIdx->aSortOrder[i]==1 );    termSortOrder = pIdx->aSortOrder[i] ^ pTerm->sortOrder;    if( i>nEqCol ){      if( termSortOrder!=sortOrder ){        /* Indices can only be used if all ORDER BY terms past the        ** equality constraints are all either DESC or ASC. */        return 0;      }    }else{      sortOrder = termSortOrder;    }    j++;    pTerm++;  }  /* The index can be used for sorting if all terms of the ORDER BY clause  ** are covered.  */  if( j>=nTerm ){    *pbRev = sortOrder!=0;    return 1;  }  return 0;}/*** Check table to see if the ORDER BY clause in pOrderBy can be satisfied** by sorting in order of ROWID.  Return true if so and set *pbRev to be** true for reverse ROWID and false for forward ROWID order.*/static int sortableByRowid(  int base,               /* Cursor number for table to be sorted */  ExprList *pOrderBy,     /* The ORDER BY clause */  int *pbRev              /* Set to 1 if ORDER BY is DESC */){  Expr *p;  assert( pOrderBy!=0 );  assert( pOrderBy->nExpr>0 );  p = pOrderBy->a[0].pExpr;  if( pOrderBy->nExpr==1 && p->op==TK_COLUMN && p->iTable==base          && p->iColumn==-1 ){    *pbRev = pOrderBy->a[0].sortOrder;    return 1;  }  return 0;}/*** Prepare a crude estimate of the logarithm of the input value.** The results need not be exact.  This is only used for estimating** the total cost of performing operatings with O(logN) or O(NlogN)** complexity.  Because N is just a guess, it is no great tragedy if** logN is a little off.*/static double estLog(double N){  double logN = 1;  double x = 10;  while( N>x ){    logN += 1;    x *= 10;  }  return logN;}/*** Find the best index for accessing a particular table.  Return a pointer** to the index, flags that describe how the index should be used, the** number of equality constraints, and the "cost" for this index.**** The lowest cost index wins.  The cost is an estimate of the amount of** CPU and disk I/O need to process the request using the selected index.** Factors that influence cost include:****    *  The estimated number of rows that will be retrieved.  (The**       fewer the better.)****    *  Whether or not sorting must occur.****    *  Whether or not there must be separate lookups in the**       index and in the main table.***/static double bestIndex(  Parse *pParse,              /* The parsing context */  WhereClause *pWC,           /* The WHERE clause */  struct SrcList_item *pSrc,  /* The FROM clause term to search */  Bitmask notReady,           /* Mask of cursors that are not available */  ExprList *pOrderBy,         /* The order by clause */  Index **ppIndex,            /* Make *ppIndex point to the best index */  int *pFlags,                /* Put flags describing this choice in *pFlags */  int *pnEq                   /* Put the number of == or IN constraints here */){  WhereTerm *pTerm;  Index *bestIdx = 0;         /* Index that gives the lowest cost */  double lowestCost;          /* The cost of using bestIdx */  int bestFlags = 0;          /* Flags associated with bestIdx */  int bestNEq = 0;            /* Best value for nEq */  int iCur = pSrc->iCursor;   /* The cursor of the table to be accessed */  Index *pProbe;              /* An index we are evaluating */  int rev;                    /* True to scan in reverse order */  int flags;                  /* Flags associated with pProbe */  int nEq;                    /* Number of == or IN constraints */  double cost;                /* Cost of using pProbe */  TRACE(("bestIndex: tbl=%s notReady=%x\n", pSrc->pTab->zName, notReady));  lowestCost = SQLITE_BIG_DBL;  pProbe = pSrc->pTab->pIndex;  /* If the table has no indices and there are no terms in the where  ** clause that refer to the ROWID, then we will never be able to do  ** anything other than a full table scan on this table.  We might as  ** well put it first in the join order.  That way, perhaps it can be  ** referenced by other tables in the join.  */  if( pProbe==0 &&     findTerm(pWC, iCur, -1, 0, WO_EQ|WO_IN|WO_LT|WO_LE|WO_GT|WO_GE,0)==0 &&     (pOrderBy==0 || !sortableByRowid(iCur, pOrderBy, &rev)) ){    *pFlags = 0;    *ppIndex = 0;    *pnEq = 0;    return 0.0;  }  /* Check for a rowid=EXPR or rowid IN (...) constraints  */  pTerm = findTerm(pWC, iCur, -1, notReady, WO_EQ|WO_IN, 0);  if( pTerm ){    Expr *pExpr;    *ppIndex = 0;    bestFlags = WHERE_ROWID_EQ;    if( pTerm->eOperator & WO_EQ ){      /* Rowid== is always the best pick.  Look no further.  Because only      ** a single row is generated, output is always in sorted order */      *pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE;      *pnEq = 1;      TRACE(("... best is rowid\n"));      return 0.0;    }else if( (pExpr = pTerm->pExpr)->pList!=0 ){      /* Rowid IN (LIST): cost is NlogN where N is the number of list      ** elements.  */      lowestCost = pExpr->pList->nExpr;      lowestCost *= estLog(lowestCost);    }else{      /* Rowid IN (SELECT): cost is NlogN where N is the number of rows      ** in the result of the inner select.  We have no way to estimate      ** that value so make a wild guess. */      lowestCost = 200;    }    TRACE(("... rowid IN cost: %.9g\n", lowestCost));  }  /* Estimate the cost of a table scan.  If we do not know how many  ** entries are in the table, use 1 million as a guess.  */  cost = pProbe ? pProbe->aiRowEst[0] : 1000000;  TRACE(("... table scan base cost: %.9g\n", cost));  flags = WHERE_ROWID_RANGE;  /* Check for constraints on a range of rowids in a table scan.  */  pTerm = findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE|WO_GT|WO_GE, 0);  if( pTerm ){    if( findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE, 0) ){      flags |= WHERE_TOP_LIMIT;      cost /= 3;  /* Guess that rowid<EXPR eliminates two-thirds or rows */    }    if( findTerm(pWC, iCur, -1, notReady, WO_GT|WO_GE, 0) ){      flags |= WHERE_BTM_LIMIT;      cost /= 3;  /* Guess that rowid>EXPR eliminates two-thirds of rows */    }    TRACE(("... rowid range reduces cost to %.9g\n", cost));  }else{    flags = 0;  }  /* If the table scan does not satisfy the ORDER BY clause, increase  ** the cost by NlogN to cover the expense of sorting. */  if( pOrderBy ){    if( sortableByRowid(iCur, pOrderBy, &rev) ){      flags |= WHERE_ORDERBY|WHERE_ROWID_RANGE;      if( rev ){        flags |= WHERE_REVERSE;      }    }else{      cost += cost*estLog(cost);      TRACE(("... sorting increases cost to %.9g\n", cost));    }  }  if( cost<lowestCost ){    lowestCost = cost;    bestFlags = flags;  }  /* Look at each index.  */  for(; pProbe; pProbe=pProbe->pNext){    int i;                       /* Loop counter */    double inMultiplier = 1;    TRACE(("... index %s:\n", pProbe->zName));    /* Count the number of columns in the index that are satisfied    ** by x=EXPR constraints or x IN (...) constraints.    */    flags = 0;    for(i=0; i<pProbe->nColumn; i++){      int j = pProbe->aiColumn[i];      pTerm = findTerm(pWC, iCur, j, notReady, WO_EQ|WO_IN, pProbe);      if( pTerm==0 ) break;      flags |= WHERE_COLUMN_EQ;      if( pTerm->eOperator & WO_IN ){        Expr *pExpr = pTerm->pExpr;        flags |= WHERE_COLUMN_IN;        if( pExpr->pSelect!=0 ){          inMultiplier *= 100;        }else if( pExpr->pList!=0 ){          inMultiplier *= pExpr->pList->nExpr + 1;        }      }    }    cost = pProbe->aiRowEst[i] * inMultiplier * estLog(inMultiplier);    nEq = i;    if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0         && nEq==pProbe->nColumn ){      flags |= WHERE_UNIQUE;    }    TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));    /* Look for range constraints    */    if( nEq<pProbe->nColumn ){      int j = pProbe->aiColumn[nEq];      pTerm = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pProbe);      if( pTerm ){        flags |= WHERE_COLUMN_RANGE;        if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pProbe) ){          flags |= WHERE_TOP_LIMIT;          cost /= 3;        }        if( findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pProbe) ){          flags |= WHERE_BTM_LIMIT;          cost /= 3;        }        TRACE(("...... range reduces cost to %.9g\n", cost));      }    }    /* Add the additional cost of sorting if that is a factor.    */    if( pOrderBy ){      if( (flags & WHERE_COLUMN_IN)==0 &&           isSortingIndex(pParse,pProbe,iCur,pOrderBy,nEq,&rev) ){        if( flags==0 ){          flags = WHERE_COLUMN_RANGE;        }        flags |= WHERE_ORDERBY;        if( rev ){          flags |= WHERE_REVERSE;        }      }else{        cost += cost*estLog(cost);        TRACE(("...... orderby increases cost to %.9g\n", cost));      }    }    /* Check to see if we can get away with using just the index without    ** ever reading the table.  If that is the case, then halve the    ** cost of this index.    */    if( flags && pSrc->colUsed < (((Bitmask)1)<<(BMS-1)) ){      Bitmask m = pSrc->colUsed;      int j;      for(j=0; j<pProbe->nColumn; j++){        int x = pProbe->aiColumn[j];        if( x<BMS-1 ){          m &= ~(((Bitmask)1)<<x);        }      }      if( m==0 ){        flags |= WHERE_IDX_ONLY;        cost /= 2;        TRACE(("...... idx-only reduces cost to %.9g\n", cost));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷综合久久久久中文一区二区 | 日韩片之四级片| 午夜精品一区在线观看| 欧美成人性战久久| 91网站最新网址| 男男视频亚洲欧美| 日韩一区有码在线| 欧美色区777第一页| 国产乱对白刺激视频不卡| 亚洲精品久久久蜜桃| 精品日韩99亚洲| 91网站在线播放| 久久99国内精品| 亚洲视频小说图片| 欧美一区二区久久| 92国产精品观看| 国产精品免费丝袜| 欧美大片在线观看一区二区| 91丨九色porny丨蝌蚪| 亚洲国产综合在线| 亚洲欧洲美洲综合色网| 日韩美女视频在线| 国产suv精品一区二区883| 精品一区在线看| 香蕉影视欧美成人| 国产精品久久久久永久免费观看| 欧美成人三级在线| 欧美日韩高清影院| 色综合一个色综合亚洲| 国产成人午夜视频| 蜜臀久久99精品久久久画质超高清| 亚洲欧美综合网| 国产精品蜜臀av| 久久网站热最新地址| 欧美精品久久久久久久多人混战 | 国产成a人亚洲精品| 亚洲精品大片www| 中文字幕不卡一区| 精品久久久久久无| 欧美福利视频一区| 国产亚洲精品中文字幕| 午夜精品久久久| 一区二区三区在线观看动漫| 亚洲欧美日韩国产中文在线| 国产日韩精品一区| 欧美一区二区三区男人的天堂| 日韩一区二区三区视频在线观看| 欧美熟乱第一页| 一本到三区不卡视频| 欧美影院午夜播放| 91精品福利在线| 国产中文一区二区三区| 国产另类ts人妖一区二区| 激情五月婷婷综合网| 看国产成人h片视频| 蜜臀av一级做a爰片久久| 免费高清在线视频一区·| 麻豆国产精品官网| 国产在线播精品第三| 激情成人综合网| 不卡的av电影在线观看| 国产69精品久久久久777| 91麻豆精品在线观看| 色天天综合久久久久综合片| 在线观看91精品国产入口| 欧美美女视频在线观看| 91麻豆精品国产91久久久更新时间 | 一区二区三区色| 亚洲精品免费播放| 日韩和欧美的一区| 亚洲一卡二卡三卡四卡五卡| 视频一区在线播放| 麻豆91精品视频| 国产麻豆一精品一av一免费| 国产风韵犹存在线视精品| 成人av动漫网站| 欧美午夜免费电影| 日韩欧美国产一区二区在线播放| 久久日韩粉嫩一区二区三区 | 欧美日韩在线精品一区二区三区激情| 99久久精品免费看国产| 欧美亚洲高清一区| 亚洲青青青在线视频| 五月激情六月综合| 久久国产夜色精品鲁鲁99| 国产盗摄精品一区二区三区在线 | 久久免费偷拍视频| 亚洲美女免费视频| 水蜜桃久久夜色精品一区的特点| 天堂在线一区二区| 成人精品免费看| 欧美日韩一本到| 欧美在线免费视屏| 成人精品一区二区三区四区 | 欧美在线不卡一区| 欧美一区二区久久| 九九热在线视频观看这里只有精品| 成人激情电影免费在线观看| 国产激情一区二区三区| 久久蜜桃av一区二区天堂| 国产精品免费视频一区| 日本免费新一区视频| 日本韩国欧美一区二区三区| 久久久久久99久久久精品网站| 欧美激情一区二区三区四区| 亚洲美女少妇撒尿| 精久久久久久久久久久| 在线视频欧美区| 一区二区三区在线免费播放| 国产 欧美在线| 国产精品久久久久久妇女6080 | 欧美精品乱码久久久久久按摩| 亚洲国产精品v| 韩国成人在线视频| 欧美电影免费观看高清完整版在| 综合久久久久综合| 69精品人人人人| 蜜桃视频在线一区| 日韩国产一区二| 亚洲欧洲日韩在线| 国产精品免费视频一区| 日韩一区精品字幕| 91免费观看在线| 精品国产99国产精品| 亚洲一区二区三区四区不卡| 国内精品视频一区二区三区八戒| 色94色欧美sute亚洲13| 亚洲国产精品99久久久久久久久| 狠狠色丁香九九婷婷综合五月| 欧美网站大全在线观看| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲人成网站影音先锋播放| 韩国一区二区在线观看| 欧美日本一道本在线视频| 亚洲一区二区三区小说| 色综合久久天天| 国产精品久久久久三级| av中文字幕不卡| 欧美一区二区三区在| 日日摸夜夜添夜夜添亚洲女人| 亚洲成人资源网| 欧美一区二区福利在线| 白白色 亚洲乱淫| 日韩av电影天堂| 欧美三级电影在线观看| 亚洲欧美影音先锋| 精品一区二区三区在线播放| 欧美一级高清片在线观看| 亚洲小说欧美激情另类| 欧美日韩在线播| 性欧美大战久久久久久久久| 国产精一区二区三区| 精品福利一区二区三区免费视频| 看国产成人h片视频| 欧美一区二区精品久久911| 麻豆精品在线看| 精品国内二区三区| 狠狠色狠狠色综合| 久久久精品人体av艺术| 精品一区二区三区在线观看| xfplay精品久久| 国产成人免费视频精品含羞草妖精| 亚洲国产精品高清| 不卡的电影网站| 悠悠色在线精品| 91精品国产乱码久久蜜臀| 裸体歌舞表演一区二区| 欧美一区二区免费观在线| 国产一区二区看久久| 亚洲国产高清aⅴ视频| 91久久一区二区| 午夜精品久久久久久久99樱桃| 欧美乱熟臀69xxxxxx| 国内偷窥港台综合视频在线播放| 久久精品人人做人人爽97| 久久国产生活片100| 久久综合五月天婷婷伊人| 狠狠久久亚洲欧美| 久久精品亚洲精品国产欧美kt∨ | 亚洲v中文字幕| 欧美日韩国产片| 日韩精品亚洲专区| 欧美成人免费网站| 日韩黄色免费网站| 国产亚洲成av人在线观看导航 | 亚洲影视在线观看| 国产一区二区三区四区五区美女| 欧美国产日韩精品免费观看| 成人av网站在线| 国产欧美一区二区在线| 99re8在线精品视频免费播放| 亚洲精品你懂的| 日韩一区和二区| 久久精品免费看| 精品乱人伦小说| 成人听书哪个软件好| 亚洲免费三区一区二区| 欧美日韩中文字幕精品| 亚洲伊人色欲综合网| 欧美日韩在线直播|