Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 88758 invoked from network); 1 Sep 2010 13:46:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Sep 2010 13:46:11 -0000 Received: (qmail 53877 invoked by uid 500); 1 Sep 2010 13:46:10 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 53105 invoked by uid 500); 1 Sep 2010 13:46:06 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 53094 invoked by uid 99); 1 Sep 2010 13:46:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 13:46:06 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.170] (HELO mail-wy0-f170.google.com) (74.125.82.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 13:45:56 +0000 Received: by wyf19 with SMTP id 19so14698753wyf.1 for ; Wed, 01 Sep 2010 06:45:36 -0700 (PDT) Received: by 10.227.127.149 with SMTP id g21mr7731409wbs.218.1283348735812; Wed, 01 Sep 2010 06:45:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.143.129 with HTTP; Wed, 1 Sep 2010 06:45:15 -0700 (PDT) X-Originating-IP: [71.92.39.5] From: Carl Hall Date: Wed, 1 Sep 2010 09:45:15 -0400 Message-ID: Subject: Converting XPath to JCR-SQL2 To: users@jackrabbit.apache.org Content-Type: multipart/alternative; boundary=0016365eebd0856a0f048f32e9b5 X-Virus-Checked: Checked by ClamAV on apache.org --0016365eebd0856a0f048f32e9b5 Content-Type: text/plain; charset=ISO-8859-1 Since XPath has been deprecated for searching, I'm working to change over some XPath queries to JCR-SQL2. I have this one that is killing performance. Translating the query below to JCR-SQL2 caused a performance problem (0.072s -> 5s+). Am I doing something wrong or is the JCR-SQL2 engine still coming along? XPath:: //*[@sling:resourceType="sakai/group-profile" and jcr:contains(.,'g-test-group')] order by @jcr:score descending JCR-SQL2:: SELECT * FROM [nt:base] as n WHERE [sling:resourceType] = "sakai/group-profile" and contains(n.*,'g-test-group') order by score() desc --0016365eebd0856a0f048f32e9b5--