X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id DB7639FA5FC for ; Sun, 2 Jul 2006 18:50:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 70572-01 for ; Sun, 2 Jul 2006 18:50:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by postgresql.org (Postfix) with ESMTP id 113159FA163 for ; Sun, 2 Jul 2006 18:50:38 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 37so920199wra for ; Sun, 02 Jul 2006 14:50:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=AYOSXd0siu9kzwH+L0H9hViJJt3BWU7XnFNOsDvSDEq2qZx9QRLUokCTWlP0WFowVwNs2SjUzOAVwkeHB05YAYhjy1spTV60Bguzm3Neu66HqondxpqiU++fOAxAWQiKJjURkkhRRIvCsslJk/REeuyn2m3L0Ih7zJfKbz6YHQo= Received: by 10.64.48.20 with SMTP id v20mr2555984qbv; Sun, 02 Jul 2006 14:50:37 -0700 (PDT) Received: by 10.65.114.11 with HTTP; Sun, 2 Jul 2006 14:50:37 -0700 (PDT) Message-ID: <430d92a20607021450i1d228350j292d68e987ed58de@mail.gmail.com> Date: Sun, 2 Jul 2006 17:50:37 -0400 From: Gene Reply-To: genekhart@gmail.com To: pgsql-performance@postgresql.org Subject: optimizing LIKE '%2345' queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/3 X-Sequence-Number: 19863 Is there any way to create a reverse index on string columns so that queries of the form: where column like '%2345'; can use an index and perform as fast as searching with like '2345%'? Is the only way to create a reverse function and create an index using the reverse function and modify queries to use: where reverse(column) like reverse('%2345') ? thanks -- Eugene Hart Cell: 443-604-2679