Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E9370109F1 for ; Tue, 10 Sep 2013 23:07:53 +0000 (UTC) Received: (qmail 44157 invoked by uid 500); 10 Sep 2013 23:07:53 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 44112 invoked by uid 500); 10 Sep 2013 23:07:53 -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 44025 invoked by uid 99); 10 Sep 2013 23:07:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Sep 2013 23:07:53 +0000 Date: Tue, 10 Sep 2013 23:07:53 +0000 (UTC) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6156) Starting Derby 10.9, we do not not keep statistics for single-column unique index. Check the code to see optimizer calculates correct cost even with the missing stats for such indexes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13763667#comment-13763667 ] Mamta A. Satoor commented on DERBY-6156: ---------------------------------------- I have looked at the optimizer related code in estimateCost of various Optimizable sub-classes and other than FromBaseTable, I do not see any other code using statistics info. Additionally PredicateList's selectivity method looks at statistics but the call to this method is from FromBaseTable:estimateCost. So, based on this, I do not believe there are other places in the code where we need to make any changes for missing stats for single column unique index. > Starting Derby 10.9, we do not not keep statistics for single-column unique index. Check the code to see optimizer calculates correct cost even with the missing stats for such indexes > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-6156 > URL: https://issues.apache.org/jira/browse/DERBY-6156 > Project: Derby > Issue Type: Task > Components: SQL, Store > Reporter: Mamta A. Satoor > Labels: derby_triage10_11 > > With DERBY-3790(Investigate if request for update statistics can be skipped for certain kind of indexes, one instance may be unique indexes based on one column.) we have stopped keeping statistics for single column unique index. But with DERBY-6045(in list multi-probe by primary key not chosen on tables with >256 rows), we found that optimizer code was not adjusted to tackle the missing stats and hence we were not picking index scan even though the single column unique index was the right choice. DERBY-6045 has been fixed but we should make sure there are no other places in the optimizer code where we have missed code changes to account for missing statistics for single-column unique indexes. -- 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