Re: select count(*) from anIntColumn where int_value = - Mailing list pgsql-performance

From Christopher Kings-Lynne
Subject Re: select count(*) from anIntColumn where int_value =
Date
Msg-id 402ADE8D.1090802@familyhealth.com.au
Whole thread Raw
In response to Re: select count(*) from anIntColumn where int_value = 0;  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-performance
>>>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.
>
>
> Has that table been updated a lot in its life?  If so, it may have had a
> problem with index bloat...

Try creating a partial index: create index blah on tablw where int_value=0;

Chris


pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: slow database
Next
From: Leon Out
Date:
Subject: Disappointing performance in db migrated from MS SQL Server