From 5a4ac1cc302388e8717f9873fc90e5b648a74eac Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 9 Dec 2021 19:42:52 +0000 Subject: [PATCH] Remove unused code and fix comments. Final cleanup before merging. FossilOrigin-Name: ce42039f5647b1f276acf5d9911528ecb47df1544a587def72c8cd6b2f664289 --- manifest | 22 +++++++++++----------- manifest.uuid | 2 +- src/malloc.c | 21 --------------------- src/sqlite.h.in | 15 +++++++++------ src/sqliteInt.h | 4 ---- src/vdbe.c | 17 ----------------- src/where.c | 6 +++--- src/wherecode.c | 2 +- 8 files changed, 25 insertions(+), 64 deletions(-) diff --git a/manifest b/manifest index a498dda5fc..d3b9720825 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enable\sbloom\sfilters\sfor\sthe\sright\stable\sof\sa\sLEFT\sJOIN.\s\sFix\sunreachable\nbranches. -D 2021-12-09T18:44:03.070 +C Remove\sunused\scode\sand\sfix\scomments.\s\sFinal\scleanup\sbefore\smerging. +D 2021-12-09T19:42:52.951 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -516,7 +516,7 @@ F src/insert.c e0293a6f686e18cb2c9dd0619a731518e0109d7e1f1db1932974659e7843cfd1 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c e1dcff1c916bf6834e150b492eddda5d9792453182d2ad64294d2266b6e93c4c F src/main.c 674a0fdfc2808e1d5a78b2eefe2ec3f93428cf82f0f6c013d577df1a1caa5940 -F src/malloc.c d9172a3946f11384f2fd6a799554ee26c6bb407c4bd0874a456ed485a2e362e4 +F src/malloc.c ef796bcc0e81d845d59a469f1cf235056caf9024172fd524e32136e65593647b F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de F src/mem2.c c8bfc9446fd0798bddd495eb5d9dbafa7d4b7287d8c22d50a83ac9daa26d8a75 @@ -553,10 +553,10 @@ F src/resolve.c 4a1db4aadd802683db40ca2dbbb268187bd195f10cbdb7206dbd8ac988795571 F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c a7a3d9f54eb24821ec5f67f2e5589b68a5d42d46fc5849d7376886777d93a85a F src/shell.c.in 239bee1085d94964f02582b0714dc3fc85cfc16e27e95813e4dbc24bb215a7e0 -F src/sqlite.h.in 50c8f27251b11f1c89b06abc6e4085fce15151bcbd355a44609ecb2ba5424841 +F src/sqlite.h.in 5999d6db0e65afbd686b76cddc385b310aa3815624edba43987913067f50e209 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 8ff2fd2c166150b2e48639f5e506fb44e29f1a3f65031710b9e89d1c126ac839 -F src/sqliteInt.h 31b9673bc26b5b2a846bf26ce7124c869f64368f4eaac865d9350749ea314000 +F src/sqliteInt.h b4391c3c2ae0a8020ce0f543fc2b529f9bcdf72ab7ba3c31d170e3228169162f F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657 F src/status.c 4b8bc2a6905163a38b739854a35b826c737333fab5b1f8e03fa7eb9a4799c4c1 F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 @@ -623,7 +623,7 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c 569349b0bddcbfbc661856f446adb92e1b0a47b3cbef548da9fc5aa639d7964c F src/vacuum.c 6c38ddc52f0619865c91dae9c441d4d48bf3040d7dc1bc5b22da1e45547ed0b3 -F src/vdbe.c 855ee903521fcc5a799f673f5b05fc599dc50a31e6cb6a15e1e8a6858087595b +F src/vdbe.c 5c05b1149a930851f36b29172002dfa56ce703e13f82d5bb4242a29dc144e350 F src/vdbe.h 25dabb25c7e157b84e59260cfb5b466c3ac103ede9f36f4db371332c47601abe F src/vdbeInt.h 910985ac2783fe0938b314d811759d53fd25caf215810f62ca1ff068d6d60d7b F src/vdbeapi.c 22c79072ae7d8a01e9bcae8ba16e918d60d202eaa9553b5fda38f99f7464d99a @@ -638,9 +638,9 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c ed0398a7adf02c31e34aada42cc86c58f413a7afe5f741a5d373ad087abde028 F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b -F src/where.c abd620b4823c0c72322ad5307805d0a350e808bd2424e3e00a1c3ecae32b8a09 +F src/where.c 71bbbac8748ddd470dd3c4213342dce2e39c2c0aa84f9b03d80bbc075fb7c502 F src/whereInt.h e83f7ba73db5b1b2685118fad67d178fbe04751a25419f0f6ff73e58b4807325 -F src/wherecode.c c2324c3204b7f51648cc71aa0c98bff3c72c96c2e0c2169809a921febef7e5e1 +F src/wherecode.c 98ec56212ea7c0993f5eb808c515076d42c814f833c1641022927903cef0e811 F src/whereexpr.c 791544603b254cf11f8e84e3b50b0863c57322e9f213b828680f658e232ebc57 F src/window.c 5d3b397b0c026d0ff5890244ac41359e524c01ae31e78782e1ff418c3e271a9e F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 @@ -1934,7 +1934,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P b11f4d080aa9e6f694e2ec401e871f42bf25997e8e8bf77fa9b6014a50466e3c -R e684e836076af2e815def08dd3898cfa +P d342ab722de1fc3f34219c9755253db9d88eb50a6fa5cc257207008b00e7fc03 +R 5df525a734b3c13f01d7f10e288ab697 U drh -Z 309930b0d62304a131a19ba2d8419e5a +Z ccda542cb10f0dae6599ca15d7e6a94e diff --git a/manifest.uuid b/manifest.uuid index c9a3436415..96b8bdf103 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d342ab722de1fc3f34219c9755253db9d88eb50a6fa5cc257207008b00e7fc03 \ No newline at end of file +ce42039f5647b1f276acf5d9911528ecb47df1544a587def72c8cd6b2f664289 \ No newline at end of file diff --git a/src/malloc.c b/src/malloc.c index 9a2eaeec15..932cecc210 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 f7cf4d2fe1..63a6f37e9a 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]]
SQLITE_STMTSTATUS_FILTER_HIT
-**
^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]] +**
SQLITE_STMTSTATUS_FILTER_HIT
+** SQLITE_STMTSTATUS_FILTER_MISS
+**
^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]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 0104bace6d..bd02e2626f 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 ef60ed0123..27e030ec19 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -671,23 +671,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 44423f4bda..be75101b26 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 8cc76b1fdf..dd73bc4e83 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( -- 2.39.5