db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r351846 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
Date Fri, 02 Dec 2005 22:42:45 GMT
Author: mikem
Date: Fri Dec  2 14:42:41 2005
New Revision: 351846

URL: http://svn.apache.org/viewcvs?rev=351846&view=rev
Log:
fix for DERBY-741.

Insure that row estimates from btree cost function never return more rows than
the btree thinks it has.  Before this change an ASSERT might fire where the
fraction estimating the percentage of rows became larger than 1 (like 1.000001).


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java?rev=351846&r1=351845&r2=351846&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
Fri Dec  2 14:42:41 2005
@@ -591,8 +591,11 @@
             if (ret_fraction < 0)
                 ret_fraction = 0;
 
-            if (SanityManager.DEBUG)
-                SanityManager.ASSERT(ret_fraction >= 0 && ret_fraction <= 1);
+            // Never return estimate of more rows than exist, sometimes 
+            // the recursive estimation through the btree may return a number
+            // like 1.00001.
+            if (ret_fraction > 1)
+                ret_fraction = 1;
 
             float estimated_row_count = input_row_count * ret_fraction;
 



Mime
View raw message