diff options
author | drh <> | 2023-09-15 14:06:44 +0000 |
---|---|---|
committer | drh <> | 2023-09-15 14:06:44 +0000 |
commit | 658096e12470ed69be9843aae6e4fd120a2c6cef (patch) | |
tree | 00399ab0f85f7d5ad886047d6025a04c11f3af03 /src | |
parent | 581b22936297aa4cc19f2ee1920804ce96d5459d (diff) | |
download | sqlite-658096e12470ed69be9843aae6e4fd120a2c6cef.tar.gz sqlite-658096e12470ed69be9843aae6e4fd120a2c6cef.zip |
The view-scan optimization was added to enhance the performance of one specific
query, but it causes performance regressions on a host of others. Disable it
(at least temporarily) in order to try to find an alternative way of fixing the
one specific query that it was created to fix - an alternative way that does
not cause performance problems for other unrelated queries.
FossilOrigin-Name: d9625a9eafe88859c3255849ee750cc6322d5a13ddad45107f9b2085c20eff50
Diffstat (limited to 'src')
-rw-r--r-- | src/where.c | 11 | ||||
-rw-r--r-- | src/whereInt.h | 2 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/where.c b/src/where.c index 01ae180ae..1d8ba88ba 100644 --- a/src/where.c +++ b/src/where.c @@ -3700,9 +3700,6 @@ static int whereLoopAddBtree( #else pNew->rRun = rSize + 16; #endif - if( IsView(pTab) || (pTab->tabFlags & TF_Ephemeral)!=0 ){ - pNew->wsFlags |= WHERE_VIEWSCAN; - } ApplyCostMultiplier(pNew->rRun, pTab->costMult); whereLoopOutputAdjust(pWC, pNew, rSize); rc = whereLoopInsert(pBuilder, pNew); @@ -5121,14 +5118,6 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ rUnsorted -= 2; /* TUNING: Slight bias in favor of no-sort plans */ } - /* TUNING: A full-scan of a VIEW or subquery in the outer loop - ** is not so bad. */ - if( iLoop==0 && (pWLoop->wsFlags & WHERE_VIEWSCAN)!=0 && nLoop>1 ){ - rCost += -10; - nOut += -30; - WHERETRACE(0x80,("VIEWSCAN cost reduction for %c\n",pWLoop->cId)); - } - /* Check to see if pWLoop should be added to the set of ** mxChoice best-so-far paths. ** diff --git a/src/whereInt.h b/src/whereInt.h index 759e774e3..343aca9f3 100644 --- a/src/whereInt.h +++ b/src/whereInt.h @@ -633,7 +633,7 @@ void sqlite3WhereTabFuncArgs(Parse*, SrcItem*, WhereClause*); #define WHERE_BLOOMFILTER 0x00400000 /* Consider using a Bloom-filter */ #define WHERE_SELFCULL 0x00800000 /* nOut reduced by extra WHERE terms */ #define WHERE_OMIT_OFFSET 0x01000000 /* Set offset counter to zero */ -#define WHERE_VIEWSCAN 0x02000000 /* A full-scan of a VIEW or subquery */ + /* 0x02000000 -- available for reuse */ #define WHERE_EXPRIDX 0x04000000 /* Uses an index-on-expressions */ #endif /* !defined(SQLITE_WHEREINT_H) */ |