Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 89888 invoked from network); 26 Jun 2008 16:44:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jun 2008 16:44:36 -0000 Received: (qmail 16421 invoked by uid 500); 26 Jun 2008 16:44:37 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 16264 invoked by uid 500); 26 Jun 2008 16:44:37 -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 16253 invoked by uid 99); 26 Jun 2008 16:44:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2008 09:44:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2008 16:43:55 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2CBBE234C154 for ; Thu, 26 Jun 2008 09:43:45 -0700 (PDT) Message-ID: <169227863.1214498625182.JavaMail.jira@brutus> Date: Thu, 26 Jun 2008 09:43:45 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-269) Provide some way to update index cardinality statistics (e.g. reimplement update statistics) In-Reply-To: <744936781.1115833984587.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 [ https://issues.apache.org/jira/browse/DERBY-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608492#action_12608492 ] Mamta A. Satoor commented on DERBY-269: --------------------------------------- ************ A user could want to update the statistics for all the indexes on a given table or s/he might want to update statistics for just a specific index. Because of this, I think we should have 2 separate stored procedures as follows 1)Following could be used to update statistics for all the indexes on a given table SYSCS_UTIL.SYSCS_UPDATE_STATISTICS_ALL_INDEXES(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128)) 2)Following could be used to update statistics of just one index SYSCS_UTIL.SYSCS_UPDATE_STATISTICS_ONE_INDEX(IN SCHEMANAME VARCHAR(128), IN INDEXNAME VARCHAR(128)) (I would love to hear other suggestions people may have for procedure names). ************ ************ If 2 stored procedues look like an overkill then the other possible (concise but not so clear syntax) solution could be to just have one stored procedure for both the options as follows SYSCS_UTIL.SYSCS_UPDATE_STATISTICS(IN SCHEMANAME VARCHAR(128), IN TABLENAME VARCHAR(128), IN INDEXNAME VARCHAR(128)) If user provides empty string or null for INDEXNAME, then statistics will be updated for all the indexes on the TABLENAME. But if a user specifies a specific INDEXNAME, then statistics will be updated only for the given INDEXNAME. (TABLENAME can be empty string or null when the user provides INDEXNAME. But if user has provided both INDEXNAME and TABLENAME, then that index should exist for the given table. If not, then an exception will be thrown). ************ If there are no preferences from the community, then I will go with the option of having 2 stored procedures. Feedback appreciated. > Provide some way to update index cardinality statistics (e.g. reimplement update statistics) > -------------------------------------------------------------------------------------------- > > Key: DERBY-269 > URL: https://issues.apache.org/jira/browse/DERBY-269 > Project: Derby > Issue Type: New Feature > Components: SQL > Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.2.2.0, 10.3.1.4 > Reporter: Stan Bradbury > Assignee: Mamta A. Satoor > > Performance problems are being reported that can be resolved by updating the cardinality statistics used by the optimizer. Currently the only time the statistics are guaranteed to be an up-to-date is when the index is first created on a fully populated table. This is most easily accomplished on an existing table by using the command: > alter table compress [sequential] > Compress table is an I/O intensive task. A better way to achieve this would be to re-enable parser support for the 'update statistics' command or re-implement the update in some other fashion. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.