-C Cherrypick\schange\s[9f14fa56ba]\s(the\sfix\sfor\s[54844eea3f])\sfrom\sthe\strunk.
-D 2011-07-12T14:48:56.574
+C Cherrypicked\sfrom\strunk:\s\sDo\snot\stry\sto\suse\sSTAT2\sfor\srow\sestimates\sif\sthe\nindex\sis\sunique\sor\snearly\sso.
+D 2011-07-13T18:53:13.589
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 543f91f24cd7fee774ecc0a61c19704c0c3e78fd
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/wal.c 5ac2119e23ee4424599d4275b66dc88d612a0543
F src/wal.h 96669b645e27cd5a111ba59f0cae7743a207bc3c
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
-F src/where.c def5ef535909779f6fe23bde7779ce6256976972
+F src/where.c db40458b67dbd77c658178ec6c53432807759c3f
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
F test/all.test 6745008c144bd2956d58864d21f7b304689c1cce
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 9bbcd8c076ce1add222da1f45ff4ee5ea2fcfc2e
-R a0a01d591a762c7dcc1325c3e75bbb8f
-U dan
-Z 72961d3db50330bb343b511f07c73431
+P 7afb2354d3791cbce00200ddee6d9f230b9452e2
+R 284ce20ede0bb04e29c76d365b6f3d0b
+U drh
+Z 90dfab96918bae66e5af513add83497e
}
#ifdef SQLITE_ENABLE_STAT2
- /* If the constraint is of the form x=VALUE and histogram
+ /* If the constraint is of the form x=VALUE or x IN (E1,E2,...)
+ ** and we do not think that values of x are unique and if histogram
** data is available for column x, then it might be possible
** to get a better estimate on the number of rows based on
** VALUE and how common that value is according to the histogram.
*/
- if( nRow>(double)1 && nEq==1 && pFirstTerm!=0 ){
+ if( nRow>(double)1 && nEq==1 && pFirstTerm!=0 && aiRowEst[1]>1 ){
if( pFirstTerm->eOperator & (WO_EQ|WO_ISNULL) ){
testcase( pFirstTerm->eOperator==WO_EQ );
testcase( pFirstTerm->pOperator==WO_ISNULL );