Re: More correlated (?) index woes

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: More correlated (?) index woes
Date: 2016-03-29 13:13:14
Message-ID: CANu8Fiw3om5RubbeV1Hzbrwq5dnWMSsU0vS-eau9UzosvdYO9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 29, 2016 at 6:47 AM, Geoff Winkless <pgsqladmin(at)geoff(dot)dj> wrote:

> On 28 March 2016 at 20:23, I wrote:
>
>> Table pa has 7522676 rows, 4834042 of which have field1 NULL, so it's
>> absolutely not reasonable to expect this to be an optimal strategy.
>> ​
>>
> It occurred to me that even though the majority of values are NULL, there
> are ​
>
> ​1691 unique values in pa.field1, so I suppose it might seem more
> attractive to the planner than it should do (that's more unique values than
> there are scdate entries).
>
> I might just set enable_seqscan to false and leave it at that. It makes me
> unhappy though.
>
> Geoff
>
>
> ​
>

>I might just set enable_seqscan to false

Geoff, that has worked for me in the past. It forces the use of index if
available, but if there is no suitable index, it will do a seq scan anyway,
so there is low risk in doing that.

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sridhar N Bamandlapally 2016-03-29 15:09:10 Re: pg_largeobject
Previous Message Alvaro Aguayo Garcia-Rada 2016-03-29 12:38:10 Re: pg_largeobject