Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 162D9632668 for ; Tue, 9 Feb 2010 04:33:26 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 00146-07 for ; Tue, 9 Feb 2010 08:33:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f222.google.com (mail-ew0-f222.google.com [209.85.219.222]) by mail.postgresql.org (Postfix) with ESMTP id 4E72C633232 for ; Tue, 9 Feb 2010 04:33:15 -0400 (AST) Received: by ewy22 with SMTP id 22so385848ewy.34 for ; Tue, 09 Feb 2010 00:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=5SWacZ1dsYWZZ3ebiiEbnJRKpL8l0Nf36hmzqhy/PRE=; b=rk/J149j+DcE8pw6t6iDNkMgGfDLLzUlh8VxeleNs6e2ziRaLvEEX8HP4/JZwCkWJJ hm6stxoV8y7UaoJ8S69IqOO0l31HnorxG/SwJUrRcdW2S09SE+Nk8asZtPTiPKuWTIn6 TM2sVbdD8UCQlCvqdzTtWhMiE+U1OqJBGZ+zM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DInEIy4SFDJJedwRjD6HMNxv7XmnmFXUhR4e3IvP8U6OxE7Dd/fhgGMuP+pR/ntj7I CH0w/+GlMcVB6AXjVycDc4Q8plG0Yx7Y5XNSzHvXrn63ZAKAEbj3FpLaYKpbDq+gXWJa qDM1eeM3T0s+ZpgFwzRLkQ+2PT4865Mk751Kk= MIME-Version: 1.0 Received: by 10.216.90.7 with SMTP id d7mr2452568wef.81.1265704393371; Tue, 09 Feb 2010 00:33:13 -0800 (PST) In-Reply-To: <2a7905441002082355w72ec4b2br9b406f186d87c12a@mail.gmail.com> References: <2a7905441002082355w72ec4b2br9b406f186d87c12a@mail.gmail.com> Date: Tue, 9 Feb 2010 01:33:13 -0700 Message-ID: Subject: Re: index is not using? From: Scott Marlowe To: AI Rumman Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.485 tagged_above=-10 required=5 tests=AWL=0.114, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/132 X-Sequence-Number: 37553 On Tue, Feb 9, 2010 at 12:55 AM, AI Rumman wrote: > I have created a index > create index leadaddress_phone_idx on > leadaddress(regexp_replace((phone)::text, '[^0-9]*'::text, ''::text, > 'g'::text)); > > But the index is not using. like '%yada' isn't capable of using an index. If it's left anchored: like 'yada%' it can.