optimizing LIKE '%2345' queries

From: Gene <genekhart(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: optimizing LIKE '%2345' queries
Date: 2006-07-02 21:50:37
Message-ID: 430d92a20607021450i1d228350j292d68e987ed58de@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mario Weilguni 2006-07-03 07:33:53 Re: optimizing LIKE '%2345' queries
Previous Message Jaime Casanova 2006-07-02 14:36:20 Re: FWD: Update touches unrelated indexes?