db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/xdocs release-changes.xml
Date Wed, 27 Aug 2003 22:50:11 GMT
mpoeschl    2003/08/27 15:50:11

  Modified:    src/java/org/apache/torque/util SqlExpression.java
               src/test/org/apache/torque/util SqlExpressionTest.java
               xdocs    release-changes.xml
  Log:
  SqlExpression: replace UniqueList with HashSet to improve performace for large IN clause.
  SqlExpressionTest.testLargeBuildInStringObjectSqlEnumBooleanDB - 93 vs 4292
  
  Revision  Changes    Path
  1.24      +3 -2      db-torque/src/java/org/apache/torque/util/SqlExpression.java
  
  Index: SqlExpression.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/util/SqlExpression.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- SqlExpression.java	10 Apr 2003 15:59:49 -0000	1.23
  +++ SqlExpression.java	27 Aug 2003 22:50:11 -0000	1.24
  @@ -56,6 +56,7 @@
   
   import java.lang.reflect.Array;
   import java.util.Date;
  +import java.util.HashSet;
   import java.util.Iterator;
   import java.util.List;
   
  @@ -509,7 +510,7 @@
           }
   
           whereClause.append(comparison);
  -        UniqueList inClause = new UniqueList();
  +        HashSet inClause = new HashSet();
           if (criteria instanceof List)
           {
               Iterator iter = ((List) criteria).iterator();
  
  
  
  1.2       +19 -1     db-torque/src/test/org/apache/torque/util/SqlExpressionTest.java
  
  Index: SqlExpressionTest.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/test/org/apache/torque/util/SqlExpressionTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SqlExpressionTest.java	19 Mar 2003 06:53:16 -0000	1.1
  +++ SqlExpressionTest.java	27 Aug 2003 22:50:11 -0000	1.2
  @@ -54,6 +54,8 @@
    * <http://www.apache.org/>.
    */
   
  +import java.lang.reflect.Array;
  +
   import junit.framework.TestCase;
   
   import org.apache.torque.adapter.DB;
  @@ -123,4 +125,20 @@
                   true, db);
           assertEquals(result, "COL IN ('42','43','44')");
   	}
  +    
  +    public void testLargeBuildInStringObjectSqlEnumbooleanDB()
  +    {
  +        int size = 10000;
  +        String[] values = new String[size];
  +        for (int i = 0; i < size; i++)
  +        {
  +            Array.set(values, i, String.valueOf(i));
  +        }
  +        long start = System.currentTimeMillis();
  +        String result = SqlExpression.buildIn("COL", values, SqlEnum.IN, 
  +                true, db);
  +        long end =  System.currentTimeMillis();
  +        System.out.println("large buildIn: " + (end - start));
  +    }
  +    
   }
  
  
  
  1.2       +17 -0     db-torque/xdocs/release-changes.xml
  
  Index: release-changes.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/release-changes.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- release-changes.xml	27 Aug 2003 06:08:57 -0000	1.1
  +++ release-changes.xml	27 Aug 2003 22:50:11 -0000	1.2
  @@ -9,6 +9,23 @@
   
     <body>
   
  +<section name="Torque 3.1-rc2">
  +<p>
  +  Changes between Torque 3.1-rc and 3.1-rc2. <br/>
  +</p>
  +
  +<subsection name="Fixed bugs">
  +<p>
  +  <ul>
  +    <li>
  +      SqlExpression: replace UniqueList with HashSet to improve performace for
  +      large IN clause.      
  +    </li>
  +  </ul>
  +</p>
  +</subsection>
  +</section>
  +
   <section name="Torque 3.1-rc">
   <p>
     Changes between Torque 3.1-beta1 and 3.1-rc. <br/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message