Add support for SQLITE_TESTCTRL_TUNE and the ".testctrl tune ID VALUE" command

in the CLI.

FossilOrigin-Name: f1199d58b9cfdcddb83bc35544ce38299ac4ed50d7ab90d33463f6ccce526feb
This commit is contained in:
drh
2021-06-04 13:16:46 +00:00
parent 2540a7482a
commit f3c1256a4d
6 changed files with 68 additions and 12 deletions
+18
View File
@@ -3741,6 +3741,20 @@ typedef struct {
#define INITFLAG_AlterRename 0x0001 /* Reparse after a RENAME */
#define INITFLAG_AlterDrop 0x0002 /* Reparse after a DROP COLUMN */
/* Tuning parameters are set using SQLITE_TESTCTRL_TUNE and are controlled
** on debug-builds of the CLI using ".testctrl tune ID VALUE". Tuning
** parameters are for temporary use during development, to help find
** optimial values for parameters in the query planner. The should not
** be used on trunk check-ins. They are a temporary mechanism available
** for transient development builds only.
*/
#define SQLITE_NTUNE 6 /* Should be zero for all trunk check-ins */
#ifdef SQLITE_DEBUG
# define Tuning(X) (sqlite3Config.aTune[X])
#else
# define Tuning(X) 0
#endif
/*
** Structure containing global configuration data for the SQLite library.
**
@@ -3805,6 +3819,10 @@ struct Sqlite3Config {
int iOnceResetThreshold; /* When to reset OP_Once counters */
u32 szSorterRef; /* Min size in bytes to use sorter-refs */
unsigned int iPrngSeed; /* Alternative fixed seed for the PRNG */
/* vvvv--- must be last ---vvv */
#ifdef SQLITE_DEBUG
sqlite3_int64 aTune[SQLITE_NTUNE]; /* Tuning parameters */
#endif
};
/*