Re: "between" is using index but "like" is not - Mailing list pgsql-novice

From Gaetano Mendola
Subject Re: "between" is using index but "like" is not
Date
Msg-id 412D4205.6000406@bigfoot.com
Whole thread Raw
In response to Re: "between" is using index but "like" is not  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
Josh Berkus wrote:

> Jesper,
>
>
>>Why doesn't it use an index on the "like" operator when it doesn't contain
>>a wildcard in the beginning of the pattern?
>
>
> How many rows are there in the table?   What happens if you force an index
> scan on the 2nd query?  Is this ASCII text or UNICODE text?
>
> Normally LIKE 'xxx%' does use an index if it's useful, so there is something
> else going on here.

Shall not him define an index with the right operator class in order to be used
with the like operator ?



Regards
Gaetano Mendola



pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: "between" is using index but "like" is not
Next
From: Bruce Momjian
Date:
Subject: Re: Questions about pg_dump file