File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5257,6 +5257,23 @@ static int prollyBtCursorNext(BtCursor *pCur, int flags){
52575257 if ( rc == SQLITE_OK ){
52585258 if ( pCur -> pCur .eState == PROLLY_CURSOR_VALID ){
52595259 pCur -> eState = CURSOR_VALID ;
5260+ /* Pre-populate the payload cache for INTKEY clean-read scans
5261+ ** (same idea as PR #770, restored on Tim's no-mutmap fast
5262+ ** path). xPayloadSize then xPayloadFetch are both called per
5263+ ** row during OP_Column / table scans; both go through
5264+ ** getCursorPayload's multi-branch chain. Caching the
5265+ ** (pData, nData) pair here makes both subsequent trips hit
5266+ ** the early-return at the top of getCursorPayload. The
5267+ ** pointer borrows the leaf node memory; CLEAR_CACHED_PAYLOAD
5268+ ** on the next move keeps it valid for exactly one row. */
5269+ if ( pCur -> curIntKey ){
5270+ const u8 * pVal ; int nVal ;
5271+ cursorCurrentTreeValue (pCur , & pVal , & nVal );
5272+ if ( nVal > 0 ){
5273+ pCur -> pCachedPayload = (u8 * )pVal ;
5274+ pCur -> nCachedPayload = nVal ;
5275+ }
5276+ }
52605277 } else {
52615278 pCur -> eState = CURSOR_INVALID ;
52625279 return SQLITE_DONE ;
You can’t perform that action at this time.
0 commit comments