aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2025-07-07 10:54:00 +0000
committerdrh <>2025-07-07 10:54:00 +0000
commit4aacd1ef8eff53662b827e920d2c7d5d46833b9d (patch)
treedad62d53a22d01c1f69de7ec34d082293d4cb479 /src
parent084046068949dfaeaae71ce4fe9cdbe5ccb24db4 (diff)
downloadsqlite-4aacd1ef8eff53662b827e920d2c7d5d46833b9d.tar.gz
sqlite-4aacd1ef8eff53662b827e920d2c7d5d46833b9d.zip
Back out the fix at [ba7d5bad32ad6aac] because it does not always work and because
it causes a performance regression. Add new test cases for row-value lookups of indexes that contain redundant columns, three of which are currently failing. This branch is seeking an improved solution to the redundant index column problem for row-value lookups. FossilOrigin-Name: ad8ddcefab5cc526b1cd77731e00939c672e61ca83350d28961b67635d20da03
Diffstat (limited to 'src')
-rw-r--r--src/build.c1
-rw-r--r--src/sqliteInt.h1
-rw-r--r--src/where.c2
3 files changed, 1 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c
index 5bd3aac3c..27d7b499d 100644
--- a/src/build.c
+++ b/src/build.c
@@ -4219,7 +4219,6 @@ void sqlite3CreateIndex(
assert( j<=0x7fff );
if( j<0 ){
j = pTab->iPKey;
- pIndex->bIdxRowid = 1;
}else{
if( pTab->aCol[j].notNull==0 ){
pIndex->uniqNotNull = 0;
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 36a21d92e..a05cf75ad 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2808,7 +2808,6 @@ struct Index {
unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */
unsigned bNoQuery:1; /* Do not use this index to optimize queries */
unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */
- unsigned bIdxRowid:1; /* One or more of the index keys is the ROWID */
unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */
unsigned bHasExpr:1; /* Index contains an expression, either a literal
** expression, or a reference to a VIRTUAL column */
diff --git a/src/where.c b/src/where.c
index ddf3f7499..6a195dd2d 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3479,7 +3479,7 @@ static int whereLoopAddBtreeIndex(
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
&& pNew->u.btree.nEq<pProbe->nColumn
&& (pNew->u.btree.nEq<pProbe->nKeyCol ||
- (pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid))
+ pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY)
){
if( pNew->u.btree.nEq>3 ){
sqlite3ProgressCheck(pParse);