Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0982E13364DE for ; Mon, 14 Feb 2011 04:10:08 -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 88117-04 for ; Mon, 14 Feb 2011 08:10:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wentylator.ang.com.pl (wentylator.ang.com.pl [89.174.215.202]) by mail.postgresql.org (Postfix) with ESMTP id 797721337990 for ; Mon, 14 Feb 2011 04:10:00 -0400 (AST) Received: from Artur7 (cfidsl [83.18.105.226]) by wentylator.ang.com.pl (Postfix) with ESMTP id D0E892DD29E; Mon, 14 Feb 2011 09:09:57 +0100 (CET) From: =?iso-8859-2?Q?Artur_Zaj=B1c?= To: "'Richard Huxton'" Cc: , References: <004601cbcc14$acfe99d0$06fbcd70$@com> <4D58D752.2000100@archonet.com> <004701cbcc18$c54c8980$4fe59c80$@com> <003801cbcc1a$37d2f7e0$a778e7a0$@ang.com.pl> <4D58DEA2.3040202@archonet.com> In-Reply-To: <4D58DEA2.3040202@archonet.com> Subject: Re: How to boost performance of queries containing pattern matching characters Date: Mon, 14 Feb 2011 09:09:55 +0100 Message-ID: <003d01cbcc1e$91241fa0$b36c5ee0$@ang.com.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJMtgQYv5PXiwGLv3AG4jOO/Eh+PwFEXM31AMeiMN4AdEajYwH9f+EJktriESA= Content-Language: pl X-wentylator-MailScanner-Information: Please contact the ISP for more information X-wentylator-MailScanner: Found to be clean X-wentylator-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6, autolearn=not spam) X-wentylator-MailScanner-From: azajac@ang.com.pl X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/379 X-Sequence-Number: 42517 > Looks like you've almost re-invented the trigram module: > http://www.postgresql.org/docs/9.0/static/pgtrgm.html I didn't know about this module. Idea to use three letters strings and use Full Text Search is the same, but the rest is not. Is the idea to use similarity for this problem is really correct? How should be query constructed to return really all records matching ILIKE criteria? ------------------------------------------- Artur Zajac