Re: select like and indexes - Mailing list pgsql-general

From Stephan Szabo
Subject Re: select like and indexes
Date
Msg-id 20030120115421.S68170-100000@megazone23.bigpanda.com
Whole thread Raw
In response to select like and indexes  ("William N. Zanatta" <william@veritel.com.br>)
List pgsql-general
>    I'm quite new to postgresql. I need some help to understand some of
> 'how it works'.
>
>    I have a table with aprox. 1 million tuples (row == tuple ??) and
> I've created an index on a column 'ip' in my table.
>
>    Well the question is: when I do,
>
>      explain analyze select * from tbl_xxxx where ip like '200%';
>
>    why PG doesn't use Index Scan method? why does it uses sequential
> scan in place?

If you aren't in the "C" locale, you won't get index scans on like
queries at all.  Recent initdbs should warn you of this.

The problem is that the conversion of the above into the currently used
indexable form (something like ip>='200' and ip<'201') doesn't necessarily
work in every locale. There's been talk at various times about this, but
I don't think anything was decided.


pgsql-general by date:

Previous
From: Michael Meskes
Date:
Subject: Re: Altering a table - positioning new columns
Next
From: "William N. Zanatta"
Date:
Subject: Help on query plan. (was: select like and indexes)