diff options
author | drh <> | 2021-12-09 19:42:52 +0000 |
---|---|---|
committer | drh <> | 2021-12-09 19:42:52 +0000 |
commit | 5a4ac1cc302388e8717f9873fc90e5b648a74eac (patch) | |
tree | 23764810a3189b746de1d3d56ad732963ddd195d /src | |
parent | a11c5e22b5eb32cdf2061a6c19fd7bf4d2a36e05 (diff) | |
download | sqlite-5a4ac1cc302388e8717f9873fc90e5b648a74eac.tar.gz sqlite-5a4ac1cc302388e8717f9873fc90e5b648a74eac.zip |
Remove unused code and fix comments. Final cleanup before merging.
FossilOrigin-Name: ce42039f5647b1f276acf5d9911528ecb47df1544a587def72c8cd6b2f664289
Diffstat (limited to 'src')
-rw-r--r-- | src/malloc.c | 21 | ||||
-rw-r--r-- | src/sqlite.h.in | 15 | ||||
-rw-r--r-- | src/sqliteInt.h | 4 | ||||
-rw-r--r-- | src/vdbe.c | 17 | ||||
-rw-r--r-- | src/where.c | 6 | ||||
-rw-r--r-- | src/wherecode.c | 2 |
6 files changed, 13 insertions, 52 deletions
diff --git a/src/malloc.c b/src/malloc.c index 9a2eaeec1..932cecc21 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -211,27 +211,6 @@ sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ return mx; } -#if 0 -/* -** Return an estimate of the amount of unallocated memory. -** -** This the hard heap limit minus the current memory usage. It might -** not be possible to allocate this much memory all at once. This is -** only an estimate. -*/ -sqlite3_int64 sqlite3EstMemoryAvailable(void){ - sqlite3_int64 n; - sqlite3_mutex_enter(mem0.mutex); - n = mem0.alarmThreshold; - if( n<=0 ) n = mem0.hardLimit; - sqlite3_mutex_leave(mem0.mutex); - if( n<=0 ) n = LARGEST_INT64; - n -= sqlite3_memory_used(); - if( n<0 ) n = 0; - return n; -} -#endif - /* ** Trigger the alarm */ diff --git a/src/sqlite.h.in b/src/sqlite.h.in index f7cf4d2fe..63a6f37e9 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -8468,12 +8468,15 @@ int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** The counter is incremented on the first [sqlite3_step()] call of each ** cycle. ** -** [[SQLITE_STMTSTATUS_FILTER HIT]] <dt>SQLITE_STMTSTATUS_FILTER_HIT</dt> -** <dd>^This is the number of times that a join step was bypassed because -** a Bloom filtered returned non-found. The corresponding -** SQLITE_STMTSTATUS_FILTER_MISS value is the number of times that the -** Bloom filter returned a find, and thus the join step had to be processed -** as normal. +** [[SQLITE_STMTSTATUS_FILTER_MISS]] +** [[SQLITE_STMTSTATUS_FILTER HIT]] +** <dt>SQLITE_STMTSTATUS_FILTER_HIT<br> +** SQLITE_STMTSTATUS_FILTER_MISS</dt> +** <dd>^SQLITE_STMTSTATUS_FILTER_HIT is the number of times that a join +** step was bypassed because a Bloom filter returned not-found. The +** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of +** times that the Bloom filter returned a find, and thus the join step +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]] <dt>SQLITE_STMTSTATUS_MEMUSED</dt> ** <dd>^This is the approximate number of bytes of heap memory diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 0104bace6..bd02e2626 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -3927,7 +3927,6 @@ 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 */ - int iEstCountScale; /* Multiple RowCountEst() by this amount */ /* vvvv--- must be last ---vvv */ #ifdef SQLITE_DEBUG sqlite3_int64 aTune[SQLITE_NTUNE]; /* Tuning parameters */ @@ -4294,9 +4293,6 @@ void sqlite3MemSetDefault(void); void sqlite3BenignMallocHooks(void (*)(void), void (*)(void)); #endif int sqlite3HeapNearlyFull(void); -#if 0 -sqlite3_int64 sqlite3EstMemoryAvailable(void); -#endif /* ** On systems with ample stack space and that support alloca(), make diff --git a/src/vdbe.c b/src/vdbe.c index ef60ed012..27e030ec1 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -672,23 +672,6 @@ static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){ } /* -** The minimum size (in bytes) for a Bloom filter. -** -** No Bloom filter will be smaller than this many bytes. But they -** may be larger. -*/ -#ifndef SQLITE_BLOOM_MIN -# define SQLITE_BLOOM_MIN 10000 -#endif - -/* -** The maximum size (in bytes) for a Bloom filter. -*/ -#ifndef SQLITE_BLOOM_MAX -# define SQLITE_BLOOM_MAX 1000000 -#endif - -/* ** Compute a bloom filter hash using pOp->p4.i registers from aMem[] beginning ** with pOp->p3. Return the hash. */ diff --git a/src/where.c b/src/where.c index 44423f4bd..be75101b2 100644 --- a/src/where.c +++ b/src/where.c @@ -4977,10 +4977,9 @@ static SQLITE_NOINLINE Bitmask whereOmitNoopJoin( ** filter. ** (2) Some searches are expected to find zero rows. (This is determined ** by the WHERE_SELFCULL flag on the term.) -** (3) The table being searched is not the right table of a LEFT JOIN -** (4) Bloom-filter processing is not disabled. (Checked by the +** (3) Bloom-filter processing is not disabled. (Checked by the ** caller.) -** (5) The size of the table being searched is known by ANALYZE. +** (4) The size of the table being searched is known by ANALYZE. ** ** This block of code merely checks to see if a Bloom filter would be ** appropriate, and if so sets the WHERE_BLOOMFILTER flag on the @@ -5000,6 +4999,7 @@ static SQLITE_NOINLINE void whereCheckIfBloomFilterIsUseful( WhereLoop *pLoop = pWInfo->a[i].pWLoop; const int reqFlags = (WHERE_SELFCULL|WHERE_COLUMN_EQ); if( (pLoop->wsFlags & reqFlags)==reqFlags + /* vvvvvv--- Always the case if WHERE_COLUMN_EQ is defined */ && ALWAYS((pLoop->wsFlags & (WHERE_IPK|WHERE_INDEXED))!=0) ){ SrcItem *pItem = &pWInfo->pTabList->a[pLoop->iTab]; diff --git a/src/wherecode.c b/src/wherecode.c index 8cc76b1fd..dd73bc4e8 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1371,7 +1371,7 @@ static void whereApplyPartialIndexConstraints( ** ** We know that an inner loop uses a Bloom filter because it has the ** WhereLevel.regFilter set. If an inner-loop Bloom filter is checked, -** then clear the WhereLoeve.regFilter value to prevent the Bloom filter +** then clear the WhereLevel.regFilter value to prevent the Bloom filter ** from being checked a second time when the inner loop is evaluated. */ static SQLITE_NOINLINE void filterPullDown( |