1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Always provide the BTREE_BULKLOAD hint, even when SQLITE_ENABLE_CURSOR_HINTS

is not defined, as that hint gives a 4% performance increase.

FossilOrigin-Name: 83a844357e132683ab3d88eee0fe32a8beeb6662
This commit is contained in:
drh
2015-08-14 23:57:04 +00:00
parent 1eb6eeb829
commit 0403cb3012
5 changed files with 28 additions and 42 deletions

View File

@@ -837,36 +837,26 @@ int sqlite3BtreeCursorRestore(BtCursor *pCur, int *pDifferentRow){
return SQLITE_OK;
}
#ifdef SQLITE_ENABLE_CURSOR_HINTS
/*
** Provide hints to the cursor. The particular hint given (and the type
** and number of the varargs parameters) is determined by the eHintType
** parameter. See the definitions of the BTREE_HINT_* macros for details.
**
** Hints are not (currently) used by the native SQLite implementation.
** This mechanism is provided for systems that substitute an alternative
** storage engine.
*/
void sqlite3BtreeCursorHint(BtCursor *pCur, int eHintType, ...){
va_list ap;
va_start(ap, eHintType);
switch( eHintType ){
case BTREE_HINT_FLAGS: {
pCur->hints = va_arg(ap, unsigned int);
assert( pCur->hints==BTREE_SEEK_EQ || pCur->hints==BTREE_BULKLOAD
|| pCur->hints==0 );
break;
}
case BTREE_HINT_RANGE: {
(void)va_arg(ap, Expr*);
(void)va_arg(ap, struct Mem*);
/* Range expression not used in this implementation */
break;
}
#ifdef SQLITE_ENABLE_CURSOR_HINTS
if( eHintType==BTREE_HINT_FLAGS )
#else
assert( eHintType==BTREE_HINT_FLAGS );
#endif
{
pCur->hints = va_arg(ap, unsigned int);
assert( pCur->hints==BTREE_SEEK_EQ || pCur->hints==BTREE_BULKLOAD
|| pCur->hints==0 );
}
va_end(ap);
}
#endif /* SQLITE_ENABLE_CURSOR_HINTS */
#ifndef SQLITE_OMIT_AUTOVACUUM
/*