Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 598B513364DE for ; Mon, 14 Feb 2011 03:49:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 02070-08 for ; Mon, 14 Feb 2011 07:49:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rs73.luxsci.com (rs73.luxsci.com [64.49.254.135]) by mail.postgresql.org (Postfix) with ESMTP id E570E1336971 for ; Mon, 14 Feb 2011 03:49:30 -0400 (AST) Received: from GNANAM ([180.151.61.10]) (authenticated bits=0) by rs73.luxsci.com (8.13.8/8.13.8) with ESMTP id p1E7nPOu028456; Mon, 14 Feb 2011 01:49:26 -0600 Reply-To: From: "Gnanakumar" To: "'Richard Huxton'" Cc: References: <004601cbcc14$acfe99d0$06fbcd70$@com> <4D58D752.2000100@archonet.com> <004701cbcc18$c54c8980$4fe59c80$@com> <4D58DC35.8010007@archonet.com> In-Reply-To: <4D58DC35.8010007@archonet.com> Subject: Re: How to boost performance of queries containing pattern matching characters Date: Mon, 14 Feb 2011 13:16:07 +0530 Organization: Zoniac Software Private Limited Message-ID: <004801cbcc1b$3f1d4fe0$bd57efa0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcvMGlUmtzutUbTYQpOteFp6r4pozgAABlAQ Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201102/373 X-Sequence-Number: 42511 > If you really need to match all those options, you can't use an index. A > substring-matching index would need to have multiple entries per > character per value (since it doesn't know what you will search for). > The index-size becomes unmanageable very quickly. > That's why I asked what you really wanted to match. To be more specific, in fact, our current application allows to delete email(s) with a minimum of 3 characters. There is a note/warning also given for application Users' before deleting, explaining the implication of this delete action (partial & case-insensitive, and it could be wide-ranging too). > So, I'll ask again: do you really want to match all of those options? Yes, as explained above, I want to match all those.