Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 72265 invoked from network); 1 Apr 2010 08:17:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Apr 2010 08:17:52 -0000 Received: (qmail 46452 invoked by uid 500); 1 Apr 2010 08:17:52 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45923 invoked by uid 500); 1 Apr 2010 08:17:49 -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 45902 invoked by uid 99); 1 Apr 2010 08:17:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 08:17:48 +0000 X-ASF-Spam-Status: No, hits=-1191.8 required=10.0 tests=ALL_TRUSTED,AWL 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, 01 Apr 2010 08:17:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4E02C234C4CF for ; Thu, 1 Apr 2010 08:17:27 +0000 (UTC) Message-ID: <1300843046.627231270109847318.JavaMail.jira@brutus.apache.org> Date: Thu, 1 Apr 2010 08:17:27 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4605) Derby Cost Based Optimizer to force the use of index In-Reply-To: <459359804.626091270103847554.JavaMail.jira@brutus.apache.org> 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-4605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852282#action_12852282 ] Knut Anders Hatlen commented on DERBY-4605: ------------------------------------------- Hi Mamatha, You need a newline after index=TIILRREP, see the second paragraph and the examples on this manual page: http://db.apache.org/derby/docs/10.5/tuning/ctunoptimzoverride.html Please direct further questions to the derby-user mailing list (http://db.apache.org/derby/derby_mail.html), as JIRA is reserved for bug reports and requests for new features. > Derby Cost Based Optimizer to force the use of index > ---------------------------------------------------- > > Key: DERBY-4605 > URL: https://issues.apache.org/jira/browse/DERBY-4605 > Project: Derby > Issue Type: Task > Components: Demos/Scripts > Affects Versions: 10.5.3.0 > Reporter: Mamatha K.V > Priority: Minor > Fix For: 10.5.3.0 > > > Hello, > Please help on the syntax of using Cost Based Optimizer that I am using. > SELECT count (REPOSITORY_KEY) from TIDLRREP --derby-properties index = TIILRREP where REPOSITORY_KEY like 'S%'; > Column name- REPOSITORY_KEY > Table - TIDLRREP > Index name - TIILRREP > Also tried using - DERBY-PROPERTIES > When I through a file using java org.apache.derby.tools.ij C:\mysql.sql > C:\GLS\myoutput.txt > Derby Database Version : db-derby-10.5.3.0-bin > mysql.sql file contains > connect 'jdbc:derby:D:\test\PerformanceTest;user=admin;password=password'; > MaximumDisplayWidth 9999; > CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1); > CALL SYSCS_UTIL.SYSCS_SET_STATISTICS_TIMING(1); > SELECT count(REPOSITORY_KEY) from TIDLRREP --derby-properties index = TIILRREP where REPOSITORY_KEY like 'S%'; > Error output in myoutput.txt > ij version 10.5 > ij> connect 'jdbc:derby:D:\test\PerformanceTest;user=admin;password=password'; > ij> MaximumDisplayWidth 9999; > ij> CALL SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1); > 0 rows inserted/updated/deleted > ij> CALL SYSCS_UTIL.SYSCS_SET_STATISTICS_TIMING(1); > 0 rows inserted/updated/deleted > ij> SELECT count(REPOSITORY_KEY) from TIDLRREP --derby-properties index = TIILRREP where REPOSITORY_KEY like 'S%';; > ERROR 42Y46: Invalid Properties list in FROM list. There is no index 'TIILRREP WHERE REPOSITORY_KEY LIKE 'S%';' on table 'TIDLRREP'. > ij> > Also I have added below entries in my derby.properties file > > derby.language.logQueryPlan=true > derby.optimizer.noTimeout=true > When I directly the query on ij ... it just hangs!! > Any help is appreciated. > Thanks > Mamatha -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.