db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6216) XPLAIN feature does not work and gives ERROR XCL16: ResultSet not open
Date Tue, 02 Jul 2013 15:10:22 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697864#comment-13697864
] 

Knut Anders Hatlen commented on DERBY-6216:
-------------------------------------------

It might be that caching the xplain-only flag is premature optimization, and that it would
be better in the first increment to check the flag via the lcc on each call to getNextRowCore().
I'd expect that to make it easier to get the correct behaviour and write tests whose results
are easier to understand. When we have well-behaved tests for the feature, it may be easier
to introduce optimizations later without breaking anything.

The patch attempts to reset the flag in the reopenCore() method. It looks like many subclasses
override that method without calling super.reopenCore(), so that may not be the most robust
place for it.

If we are to cache the value in BasicNoPutResultSetImpl/NoPutResultSetImpl, I'm wondering
if it might be better if the flag has three possible values: true, false, unknown. The flag
is initialized to unknown in the constructor. If getNextRowCore() sees that it is unknown,
it initializes by looking up the value in the lcc. The flag could be reset to unknown in close().
(Of course, it still has the weakness that subclasses that override close() must remember
to call super.close(), but at least that requirement is called out in NoPutResultSetImpl.close()'s
javadoc comment, so it's a bug if a class doesn't already do that.)
                
> XPLAIN feature does not work and gives ERROR XCL16: ResultSet not open
> ----------------------------------------------------------------------
>
>                 Key: DERBY-6216
>                 URL: https://issues.apache.org/jira/browse/DERBY-6216
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 10.6.2.3, 10.7.1.4, 10.8.3.1, 10.9.1.0
>         Environment: Solaris 10, MacOS X 10.6, Windows XP
>            Reporter: Brett Bergquist
>            Assignee: Bryan Pendleton
>              Labels: derby_triage10_11, features
>         Attachments: addTests.diff, emptyRS.diff, preparedTests.diff, xplain-only.diff
>
>
> I am running Derby 10.9.1.0 and am trying to figure out a  performance problem with query
taking too long.   I don’t actually want to run the query so from the documentation, I try:
> call syscs_util.syscs_set_runtimestatistics(1);
> call syscs_util.syscs_set_xplain_schema('STATS');
> call syscs_util.syscs_set_xplain_mode(1);
> --- my query here
> call syscs_util.syscs_set_runtimestatistics(0);
> call syscs_util.syscs_set_xplain_schema('');
> call syscs_util.syscs_set_xplain_mode(0);
> When it runs my query, I get:
> ERROR XCL16: ResultSet not open. Operation 'getMetaData' not permitted. Verify that autocommit
is OFF.
> I try the following with IJ just to see:
> call syscs_util.syscs_set_runtimestatistics(1);
> call syscs_util.syscs_set_xplain_schema('STATS');
> call syscs_util.syscs_set_xplain_mode(1);
> select sql_text from syscs_diag.transaction_table where status != 'IDLE';
> call syscs_util.syscs_set_runtimestatistics(0);
> call syscs_util.syscs_set_xplain_schema('');
> call syscs_util.syscs_set_xplain_mode(0);
> Note I have tried this with real tables as apposed to the syscs_diag.transaction_table
with the same result.  The only reason that I posted this with this table is that it is a
table that is accessible for any database.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message