Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 24909 invoked from network); 13 Oct 2010 16:28:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Oct 2010 16:28:22 -0000 Received: (qmail 75057 invoked by uid 500); 13 Oct 2010 16:28:22 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 75009 invoked by uid 500); 13 Oct 2010 16:28:22 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 75002 invoked by uid 99); 13 Oct 2010 16:28:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 16:28:22 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [148.87.113.121] (HELO rcsinet10.oracle.com) (148.87.113.121) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Oct 2010 16:28:11 +0000 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9DGRnbc009346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Oct 2010 16:27:50 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9DGRm6G031718 for ; Wed, 13 Oct 2010 16:27:48 GMT Received: from abhmt016.oracle.com by acsmt354.oracle.com with ESMTP id 687996121286987265; Wed, 13 Oct 2010 09:27:45 -0700 Received: from [129.159.139.223] (/129.159.139.223) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 13 Oct 2010 09:27:43 -0700 Message-ID: <4CB5DE15.9070109@oracle.com> Date: Wed, 13 Oct 2010 18:28:05 +0200 From: Kristian Waagan User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.7) Gecko/20100830 Thunderbird/3.1.1 MIME-Version: 1.0 To: Derby Development Subject: XPLAIN and statement recompilation (invalidation) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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