Re: [HACKERS] OR clause status report - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] OR clause status report
Date
Msg-id 35C1C5A2.EAFC6C65@krs.ru
Whole thread Raw
In response to RE: [HACKERS] OR clause status report  (Vince Vielhaber <vev@michvhf.com>)
Responses Re: [HACKERS] OR clause status report  (Vince Vielhaber <vev@michvhf.com>)
List pgsql-hackers
Vince Vielhaber wrote:
>
> Now I've been wondering why my selects are so slow.  Is this telling me
> that they're NOT using the index?  And if not, any ideas why?
>
> The select returned 35 rows out of approx 170,000.
>
> -----
> campsites=> explain select * from locations where lower(city)='oxford';
                                                    ^^^^^^^^^^^
You should

create index index_name on locations (lower(city))
                                      ^^^^^
- this is known as functional index...

> NOTICE:  QUERY PLAN:
>
> Seq Scan on locations  (cost=7263.30 size=84899 width=32)

Vadim

pgsql-hackers by date:

Previous
From: Vince Vielhaber
Date:
Subject: RE: [HACKERS] OR clause status report
Next
From: Vince Vielhaber
Date:
Subject: Re: [HACKERS] OR clause status report