Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 91105 invoked from network); 7 Dec 2005 23:52:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Dec 2005 23:52:39 -0000 Received: (qmail 83233 invoked by uid 500); 7 Dec 2005 23:52:32 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 83171 invoked by uid 500); 7 Dec 2005 23:52:32 -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 83139 invoked by uid 99); 7 Dec 2005 23:52:32 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2005 15:52:32 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id E63AE186 for ; Thu, 8 Dec 2005 00:52:10 +0100 (CET) Message-ID: <633110229.1133999530941.JavaMail.jira@ajax.apache.org> Date: Thu, 8 Dec 2005 00:52:10 +0100 (CET) From: "Mike Matrigali (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-737) SYSCS_UTIL.SYSCS_COMPRESS_TABLE should create statistics if they do not exist In-Reply-To: <958154311.1133398470339.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-737?page=comments#action_12359669 ] Mike Matrigali commented on DERBY-737: -------------------------------------- I don't see any downside to creating the statistics whether they exist or not. Not sure why the distinction was made. First try at this might be just removing the if in opensource/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java!updateIndex(): if (td.statisticsExist(cd)) { cCount = new CardinalityCounter(tc.openSortRowSource(sortIds[ind ex])); updateStatistics = true; } else cCount = tc.openSortRowSource(sortIds[index]); But life is probably not that easy. Likely there is slightly more work to create the statistics row vs. updating it. The work to insert the row can be found in: opensource/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java > SYSCS_UTIL.SYSCS_COMPRESS_TABLE should create statistics if they do not exist > ----------------------------------------------------------------------------- > > Key: DERBY-737 > URL: http://issues.apache.org/jira/browse/DERBY-737 > Project: Derby > Type: Improvement > Components: SQL > Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.1.1, 10.1.1.2, 10.1.2.0, 10.1.2.1, 10.2.0.0, 10.1.3.0, 10.1.2.2, 10.0.2.2 > Reporter: Kathey Marsden > Priority: Minor > > There must be an entry in the SYSSTATISTICS table in order for the cardinality statistics in SYSSTATISTICS to be created with SYSCS_UTIL.SYSCS_COMPRESS_TABLE > SYSCS_UTIL.SYSCS_COMPRESS_TABLE should create statistics if they don't exist. The only way to create them if the index was created on an empty table, seems to be to drop and recreate the index after the table has been loaded. > The documentation will also need updating if this change is made. > http://db.apache.org/derby/docs/10.1/tuning/ctunstats57373.html -- 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