db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <kristian.waa...@oracle.com>
Subject XPLAIN and statement recompilation (invalidation)
Date Wed, 13 Oct 2010 16:28:05 GMT
  Hi,

When testing the automatic index statistics update prototype, 
lang.XplainStatisticsTest started failing intermittently.
A quick investigation suggests this is caused by a recompilation request 
being raised at that "appropriate" place in the code. In this case the 
recompilation is caused by the invalidation request made by the index 
stats daemon when writing the new statistics to the data dictionary.
On my machine the test fails one to two times out of 25 when run standalone.

The result of the above event is that an entry for the query is added 
twice to SYSXPLAIN_STATEMENTS; once when the recompilation of the query 
is triggered, and once when the query has completed. Both happens due to 
an internal result set being closed.

It is simple enough to avoid this in the test, but the question is if 
this can be a problem in the more general case?
In the worst case, the contents of SYSXPLAIN_STATEMENTS (and potentially 
other XPLAIN tables) may not correspond completely to the queries issued 
by the user(s).

For the curious, the code causing the addition of an entry to the XPLAIN 
table is [1] (see around line 389 in the close-method).

I'll probably file a JIRA to track this, as I don't think the code was 
intended to work in this way.
I don't plan to fix it (now) as I suspect the user impact is low.


-- 
Kristian

[1] 
http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java?view=markup



Mime
View raw message