Re: select count(*) from anIntColumn where int_value = 0; is very slow

From: PC Drew <drewpc(at)ibsncentral(dot)com>
To: David Teran <david(dot)teran(at)cluster9(dot)com>
Cc: PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>
Subject: Re: select count(*) from anIntColumn where int_value = 0; is very slow
Date: 2004-02-11 13:42:19
Message-ID: 1CC1B9FA-5C98-11D8-8191-000A95EA00C0@ibsncentral.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Had you done a VACUUM ANALYZE at all? There has been much discussion
lately about the planner needing to be updated to know that the index
is a better choice.

On Feb 11, 2004, at 6:32 AM, David Teran wrote:

> Hi,
>
>> Is your int_value data type int4? If not then use "... from
>> job_property
>> where int_value = '0'"
>> Indexes are used only if datatypes matches.
>>
> tried those variations already. Strange enough, after dropping and
> recreating the index everything worked fine.
>
> regards David
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo(at)postgresql(dot)org
>

--
PC Drew
Manager, Dominet

IBSN
1600 Broadway, Suite 400
Denver, CO 80202

Phone: 303-984-4727 x107
Cell: 720-841-4543
Fax: 303-984-4730
Email: drewpc(at)ibsncentral(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message stefan bogdan 2004-02-11 14:08:07 update performance
Previous Message David Teran 2004-02-11 13:32:00 Re: select count(*) from anIntColumn where int_value = 0; is very slow