Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B3EFE0B5 for ; Fri, 22 Feb 2013 09:35:39 +0000 (UTC) Received: (qmail 79512 invoked by uid 500); 22 Feb 2013 09:35:38 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 79300 invoked by uid 500); 22 Feb 2013 09:35:37 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 79272 invoked by uid 99); 22 Feb 2013 09:35:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2013 09:35:36 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of elecharny@gmail.com designates 209.85.212.180 as permitted sender) Received: from [209.85.212.180] (HELO mail-wi0-f180.google.com) (209.85.212.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2013 09:35:27 +0000 Received: by mail-wi0-f180.google.com with SMTP id hi8so461974wib.13 for ; Fri, 22 Feb 2013 01:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=fVV5bErBL9LFeFFJXHc4UlNeyATK2CYPmhmV9oeouXg=; b=oQy/xvlZB5p1UJ4xmxY/WxLuMPV8fFKocoK4n81Y6EVV96j5nJ7+2OFW2FIvpSwNZC vBOxZkorZOhnO786/1AL1/nor0V4TUkOPu+eDI9i56FrtAGVhojoAX9HW9Rb7/dKDgrg ZUuZnB7PCE6JVo2bAxLEmuvGMWGK0zz/fkn4RpV9m39bYyQPtyHnWetsc+V6CK0Ro1f9 8tNMbsoLPYt9EjHD1voGCIIfN2g6Hcgt3POD4jFfmAq5M2zrFbxo6l3XGQMLQFz1/MJT lHvCp8aNpGsde60itdADfGfQ8sJHwWynCgsvuLtwFjJNutnvPMD5CELDx0DB5TbU/JFH hHaA== X-Received: by 10.180.92.39 with SMTP id cj7mr47354964wib.19.1361525707493; Fri, 22 Feb 2013 01:35:07 -0800 (PST) Received: from Emmanuels-MacBook-Pro.local (ran75-1-78-192-106-184.fbxo.proxad.net. [78.192.106.184]) by mx.google.com with ESMTPS id dw1sm2391947wib.5.2013.02.22.01.35.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Feb 2013 01:35:06 -0800 (PST) Message-ID: <51273BC8.20107@gmail.com> Date: Fri, 22 Feb 2013 10:35:04 +0100 From: =?UTF-8?B?RW1tYW51ZWwgTMOpY2hhcm55?= Reply-To: elecharny@apache.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Substring filter : how to improve their use ? References: <51266410.9050803@gmail.com> <4648C0CE9B4E48679C67F2D07B2BB8B6@gmail.com> In-Reply-To: <4648C0CE9B4E48679C67F2D07B2BB8B6@gmail.com> X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Le 2/22/13 8:59 AM, Ludovic Poitou a écrit : > Hi Emmanuel, Hi Ludovic > > You might want to eval the scope after the filter rather than initially. > In most real life deployments, applications are searching for a single user, like (uid=elecharny), as a subtree through the whole directory. The scope becomes irrelevant then. It will be disacarded as we will have only one candidate (or a few) that match the uid filter, understood. > So checking the scope first adds processing of no value. For us, it's just a matter of pulling a number from an index, which is just a call to a method accessing the Rdn index to fetch the base oject, but again, it will contain the number of direct children and the number of descendants, so it's fast (especially if it's in cache). Now, if a filter like (cn=elecharny returns 0 or 1, we can avoid such a call, that's for sure. So I will apply the suggestion, and add the scope *only* if the number is below a certain threshold (5, 10 whatever). Very good suggestion ! Brillant ! -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com