Re: LIKE and indexes? - Mailing list pgsql-general

From adb
Subject Re: LIKE and indexes?
Date
Msg-id Pine.GSO.4.10.10103141617350.2561-100000@hairdini.beast.com
Whole thread Raw
In response to LIKE and indexes?  (Alexander Jerusalem <alexander.jerusalem@pop.chello.at>)
List pgsql-general
When in doubt, try the explain command

Not exactly sure about postgres but in general LIKE can
only use an index in the case of LIKE "Something%"

LIKE "%Something" or LIKE "%Something%"
won't use an index since it would have to scan the entire
index to find all matches.

Alex.



On Wed, 14 Mar 2001, Alexander Jerusalem wrote:

> Hi,
>
> Can anyone telle me if and when a LIKE query uses an index? I've compiled
> postgres with locale support. Does that have any influence indexes?
>
> thanks,
>
> Alexander Jerusalem
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


pgsql-general by date:

Previous
From: adb
Date:
Subject: Re: Fast Inserts and Hardware Questions
Next
From: Orion Henry
Date:
Subject: Re: Fast Inserts and Hardware Questions