db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1957) Factor out run-time statistics information from language ResultSet classes
Date Thu, 12 Oct 2006 08:30:37 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1957?page=comments#action_12441664 ] 
            
Knut Anders Hatlen commented on DERBY-1957:
-------------------------------------------

Daniel John Debrunner wrote this in a comment to DERBY-1876:

> I've thought in the past about having the common statistic
> information in a language ResultSet implementation that could wrap
> the real langugae ResultSet. Then the ResultSetFactory would return
> a instance of the real ResultSet wrapped with a StatisticsResultSet
> when timing etc. was enabled. The StatisticsResultSet would have
> code like:
>
> class StatisticsResultSet {
>    private long openTime;
>
>    private final ResultSet rs;
>
>    pubic void openCore() {
>        long s = System.currentTimeMillis();
>        rs.openCore();
>        long e = System.currentTimeMillis();
>
>        openTime += (e -s);
>    }
>
> This then removes the common fields and code to get the times from
> all the ResultSet classes, also leading to consistency.
>
> The issue with this that code that performs instanceof checks to get
> specific behaviour of a ResultSet no longer works, though there are
> solutions to that:
>     A) Don't do it, it breaks the api in that the ResultSetFactory
>        says it is returning a ResultSet, so that's all the callers
>        should depend on.
>     B) Follow the JBDC wrapper model, have a getRealResultSet() call
>        in ResultSet api which would return this for most
>        implementations, but the wrapped rs for
>        StatisticsResultSet. Then code that needed to access the
>        specific class would use the return from that method.

> Factor out run-time statistics information from language ResultSet classes
> --------------------------------------------------------------------------
>
>                 Key: DERBY-1957
>                 URL: http://issues.apache.org/jira/browse/DERBY-1957
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL, Performance
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>
> The discussion in DERBY-1876 indicated that the performance of simple queries could be
improved by factoring out run-time statistics information from the language ResultSet classes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message