Re: [SQL] Yet Another (Simple) Case of Index not used - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: [SQL] Yet Another (Simple) Case of Index not used
Date
Msg-id 20030408185412.C57783-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: [SQL] Yet Another (Simple) Case of Index not used  ("Denis @ Next2Me" <denis@next2me.com>)
List pgsql-performance
On Tue, 8 Apr 2003, Denis @ Next2Me wrote:

> The kind of requests that I am really interested in are:
> select count(*) from table where table.column like 'pattern%'

If you think an index scan should be faster, you can try
set enable_seqscan=off;
and see if that changes the plan generated by explain and with analyze
you can compare the time used.  Without information on the estimated
selectivity it's hard to say what's right.

If it doesn't use the index (ie, it's still using a sequential scan)
after the enable_seqscan=off it's likely that you didn't initdb in "C"
locale in which case like won't use indexes currently (you can see the
archives for long description, but the short one is that some of the
locale rules can cause problems with using the index).


pgsql-performance by date:

Previous
From: "Denis @ Next2Me"
Date:
Subject: Re: [SQL] Yet Another (Simple) Case of Index not used
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: [SQL] Yet Another (Simple) Case of Index not used