db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r354106 - /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
Date Mon, 05 Dec 2005 17:24:55 GMT
Author: mikem
Date: Mon Dec  5 09:24:53 2005
New Revision: 354106

URL: http://svn.apache.org/viewcvs?rev=354106&view=rev
Log:
Fix for DERBY-741, ported from trunk to 10.1 line.

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/branches/10.1/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java?rev=354106&r1=354105&r2=354106&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/access/btree/BTreeCostController.java
Mon Dec  5 09:24:53 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