Fossil SCM

Adjust foci's xBestIndex() cost from 1 to 100 to address the performance regression report in [forum:2d15009e0e|forum post 2026-10-07T16:33:27Z]. A value of 10 performed equivalently to 1.

stephan 2026-10-11 12:12 UTC trunk
Commit 06ef844171929726ac8d7ca9bae43ad1d62856cf3129dadf5f621de995503ff3
1 file changed +3 -1
+3 -1
--- src/foci.c
+++ src/foci.c
@@ -133,11 +133,13 @@
133133
if( pIdxInfo->aConstraint[i].iColumn==FOCI_CHECKINID ){
134134
pIdxInfo->idxNum = 1;
135135
}else{
136136
pIdxInfo->idxNum = 2;
137137
}
138
- pIdxInfo->estimatedCost = 1.0;
138
+ pIdxInfo->estimatedCost = 100.0
139
+ /* values of 1 (historical) and 10 (tested) can make this
140
+ ** extremely slow. forum:2d15009e0e */ ;
139141
pIdxInfo->aConstraintUsage[i].argvIndex = 1;
140142
pIdxInfo->aConstraintUsage[i].omit = 1;
141143
break;
142144
}
143145
}
144146
--- src/foci.c
+++ src/foci.c
@@ -133,11 +133,13 @@
133 if( pIdxInfo->aConstraint[i].iColumn==FOCI_CHECKINID ){
134 pIdxInfo->idxNum = 1;
135 }else{
136 pIdxInfo->idxNum = 2;
137 }
138 pIdxInfo->estimatedCost = 1.0;
 
 
139 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
140 pIdxInfo->aConstraintUsage[i].omit = 1;
141 break;
142 }
143 }
144
--- src/foci.c
+++ src/foci.c
@@ -133,11 +133,13 @@
133 if( pIdxInfo->aConstraint[i].iColumn==FOCI_CHECKINID ){
134 pIdxInfo->idxNum = 1;
135 }else{
136 pIdxInfo->idxNum = 2;
137 }
138 pIdxInfo->estimatedCost = 100.0
139 /* values of 1 (historical) and 10 (tested) can make this
140 ** extremely slow. forum:2d15009e0e */ ;
141 pIdxInfo->aConstraintUsage[i].argvIndex = 1;
142 pIdxInfo->aConstraintUsage[i].omit = 1;
143 break;
144 }
145 }
146

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button