From: drh Date: Fri, 7 Jun 2013 02:04:19 +0000 (+0000) Subject: Must faster computation of estimated logarithm. X-Git-Tag: version-3.8.0~130^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23fec451a6bdb4d0b598592c66567ef7f6485330;p=thirdparty%2Fsqlite.git Must faster computation of estimated logarithm. FossilOrigin-Name: dfbca3acaeb862f24f25e7810a16ff2066111ff4 --- diff --git a/manifest b/manifest index 6c3bd8a20c..d0734bd638 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Further\sprepare-time\sperformance\simprovements. -D 2013-06-07T00:29:23.782 +C Must\sfaster\scomputation\sof\sestimated\slogarithm. +D 2013-06-07T02:04:19.774 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73 -F src/where.c bbd8aad0e54692a107d0f68111a289149814b10c +F src/where.c 70e1ebd1c3f828f4062fc2b5ada2461419020dae F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6 @@ -1094,7 +1094,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 9f8e84ab9874a8af826763b1669adb57abd493ea -R 8930578735fbc55c72ec3d27796f6bd0 +P 02741d177bfc2fca23bc99974cd899eba13cb59a +R 8ee17766ef9ac6851fd1329c34593963 U drh -Z c23263f2bef48916be7bbfa11913b59d +Z adf16c6d5fc0c897d258a12782d83ad0 diff --git a/manifest.uuid b/manifest.uuid index aaaa9ad535..8ae2ff38a7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -02741d177bfc2fca23bc99974cd899eba13cb59a \ No newline at end of file +dfbca3acaeb862f24f25e7810a16ff2066111ff4 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 3b825214f5..c1fc4301d7 100644 --- a/src/where.c +++ b/src/where.c @@ -1831,13 +1831,11 @@ static int isDistinctRedundant( ** logN is a little off. */ static WhereCost estLog(WhereCost N){ - WhereCost logN = 1; - WhereCost x = 10; - while( N>x ){ - logN += 1; - x *= 10; - } - return logN; + u32 a; + assert( sizeof(WhereCost)==4 ); /* 32-bit float input */ + if( N<=0.0 ) return 0.0; + memcpy(&a, &N, 4); + return ((a >>= 23)-127)*0.3; } /* @@ -5398,6 +5396,7 @@ WhereInfo *sqlite3WhereBegin( /* Construct the WhereLoop objects */ WHERETRACE(("*** Optimizer Start ***\n")); + /* TBD: if( nTablist==1 ) whereCommonCase(&sWLB); */ rc = whereLoopAddAll(&sWLB); if( rc ) goto whereBeginError;