Ok all, here's a topic on performance.  I'd appreciate your opinions.

Relevant documents would be the mm-mysql-driver interface....code for
ResultSet, and Statement.
I have the following issues... One... when I ask for a query where I'm going
to get 1Million rows, what I see is that my JVMachine steadily increases
memory as I loop through the recordset.  I performed tests, such that, I
have no other code in the loop other than rs.next().  And we see a steadily
increasing footprint, ultimately until the JVM takes over the machine, and
backs the server into a corner.  My cursor type is forward only, and I'm
setting the FetchSize to 1000.  So in THEORY, we should have a limited
footprint for the paging of the recordset... AND... as I move through the
recordset, it should letgo of the rows as I pass them, but the memory
examples show otherwise.

Look at this....

Looking at the code in the mm_mysql_driver2.0.4 we see that the resultset's
code looks like this:


    public boolean next() throws java.sql.SQLException
    {
        if (!reallyResult()){
          throw new java.sql.SQLException("ResultSet is from UPDATE. No
Data", "S1000");
      }

        if (currentRow + 1 >= Rows.size()) {
            return false;
        }
        else {
            clearWarnings();
            currentRow = currentRow + 1;
            This_Row = (byte[][])Rows.elementAt(currentRow);
            return true;
        }
    }


IF, as would logically be expected... there SHOULD be some cusor branching
logic in here somewhere.... but there is nothing... Furthermore... in a
forward only cursor I would see the Vector Variable called Rows  (at the
bottom of the function)  be used entirely differently... i.e.  Instead of
incrementing the currentRow marker... I would expect to see
Rows.removeElement(0)..... thus the current row marker would always be 0, as
we called next() we would shrink the vector....and the memory
requirements....        but reading on in the code.... the ResultSet object
ALWAYS supports previous() as a valid method.... so setting the cursor type
is meaningless for mm_mysql2.0.4's driver..... FURTHER MORE.... there is
ZERO mention of the fetch size in any of the packages code.... DISPITE the
interface requireing the support of setting the fetch size.....

Could someone tell me if the is a scenario where I take the code and make my
own?  That would be my first foray into open-source manipulation of
code..... is this that sort of instance?  And perhaps if there are better
drivers out there for my application?



-TheMechE























Reply via email to