Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52FB81021C for ; Fri, 11 Apr 2014 16:16:15 +0000 (UTC) Received: (qmail 91640 invoked by uid 500); 11 Apr 2014 16:16:15 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 91221 invoked by uid 500); 11 Apr 2014 16:16:12 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 91201 invoked by uid 99); 11 Apr 2014 16:16:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2014 16:16:08 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of frank.rivera@houdiniesq.com designates 69.16.252.128 as permitted sender) Received: from [69.16.252.128] (HELO HoudiniESQ.com) (69.16.252.128) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Apr 2014 16:16:01 +0000 Received: (qmail 2628 invoked by uid 2526); 11 Apr 2014 12:15:38 -0400 Received: from rrcs-24-172-59-178.midsouth.biz.rr.com by HoudiniESQ.com (envelope-from , uid 2020) with qmail-scanner-2.05st (perlscan: 2.05st. Clear:RC:1(24.172.59.178):. Processed in 0.051652 secs); 11 Apr 2014 16:15:38 -0000 Received: from rrcs-24-172-59-178.midsouth.biz.rr.com (HELO ?192.168.1.29?) (24.172.59.178) by 69.16.252.129 with SMTP; 11 Apr 2014 12:15:38 -0400 From: Frank Rivera Content-Type: multipart/alternative; boundary="Apple-Mail=_ACFC740A-F1F2-45B9-82DE-5B9AB5BBC88B" Subject: Fwd: When to shut down a database Date: Fri, 11 Apr 2014 12:15:37 -0400 References: To: derby-user@db.apache.org Message-Id: <7EE7B953-7B72-4363-B5C6-0EA083122402@HoudiniESQ.com> Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_ACFC740A-F1F2-45B9-82DE-5B9AB5BBC88B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 We have a simple query using LIKE but is very slow. We need to tell the = optimizer which index to use but the override DERBY-PROPERTIES statement = returns an error. here is the SQL. SELECT=20 esq.attachment.guid=20 FROM=20 esq.attachment=20 --DERBY-PROPERTIES index =3D ATTACHMENT_LINKNAMES_INDEX where=20 ( =20 esq.attachment.file_name LIKE =91%drisco%'=20 OR esq.attachment.file_index_name LIKE =91%drisco%'=20 ) AND ( esq.attachment.link_guid IS NOT NULL=20 AND=20 esq.attachment.link_table=3D'mat' =20 AND=20 esq.attachment.link_guid IN ( SELECT esq.matter.guid=20 FROM esq.matter=20 WHERE=20 esq.matter.guid=3Desq.attachment.link_guid=20 AND (=20 ( esq.matter.grp_guid=3D0 OR = esq.matter.grp_guid IS NULL ) OR ( esq.matter.grp_guid>0 AND = esq.matter.grp_guid IN ( 2,1,6,4,3 ) )=20 ) =20 =20 ) ) ; =20 Sincerely, Frank Rivera LogicBit Software - Research Triangle Park, North Carolina =09 =09 --Apple-Mail=_ACFC740A-F1F2-45B9-82DE-5B9AB5BBC88B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
We have a simple query using LIKE but is very = slow. We need to tell the optimizer which index to use but the override = DERBY-PROPERTIES statement returns an error. here is the = SQL.

SELECT 
esq.attachment.g= uid 
FROM 
esq.attachment 
--= DERBY-PROPERTIES index =3D = ATTACHMENT_LINKNAMES_INDEX
where 
( =   
  esq.attachment.file_name =  LIKE =91%drisco%' 
   OR = esq.attachment.file_index_name  LIKE = =91%drisco%' 
)
AND
(
  =       esq.attachment.link_guid IS NOT = NULL 
        = AND 
        = esq.attachment.link_table=3D'mat'  
      =   AND 
        = esq.attachment.link_guid IN (
        =         SELECT = esq.matter.guid 
          =       FROM esq.matter 
    =             WHERE 
  =               = esq.matter.guid=3Desq.attachment.link_guid 
    =             AND ( 
= ( esq.matter.grp_guid=3D0 OR esq.matter.grp_guid IS NULL ) OR ( = esq.matter.grp_guid>0 AND esq.matter.grp_guid IN ( 2,1,6,4,3 ) = ) 
) =   
              =           
      =   )
) ;
  =  




Sincerely,

  = Frank Rivera
= LogicBit Software - Research Triangle Park, North = Carolina
=
=

<= /div>
= --Apple-Mail=_ACFC740A-F1F2-45B9-82DE-5B9AB5BBC88B--