Re: Is my text_pattern_ops index working for a LIKE prefix searchwith column reference? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Is my text_pattern_ops index working for a LIKE prefix searchwith column reference?
Date
Msg-id d599d4592b68dbac18beab4daf15358a4bfa9b64.camel@cybertec.at
Whole thread Raw
In response to Is my text_pattern_ops index working for a LIKE prefix search withcolumn reference?  (Seamus Abshere <seamus@abshere.net>)
Responses Re: Is my text_pattern_ops index working for a LIKE prefix search with column reference?
List pgsql-general
Seamus Abshere wrote:
> I created an index with text_pattern_ops because I want fast prefix search [1] [2].
> 
> ...but I don't think it's working when I use a column reference || '%'...

An index can only be used for expressions like

   <indexed expression> <operator from the opclass> <constant>

and you have a column refrence on the right side.

Perhaps you can rephrase your query in such a fashion.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Join condition parsing puzzle
Next
From: Raghavendra Rao J S V
Date:
Subject: