Re: Index only scan sometimes switches to sequential scan for small amount of rows - Mailing list pgsql-performance

From Feike Steenbergen
Subject Re: Index only scan sometimes switches to sequential scan for small amount of rows
Date
Msg-id CAK_s-G0O4VK-J-9BQtShU1_Osr3NG1_T7VDDXRniXTd9VYPdHw@mail.gmail.com
Whole thread Raw
In response to Re: Index only scan sometimes switches to sequential scan for small amount of rows  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: Index only scan sometimes switches to sequential scan for small amount of rows
List pgsql-performance
Hi, thanks for having a look and thinking with us

On 25 March 2015 at 13:45, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
> Can you post results for this query?
>
> SELECT stats, COUNT(*) FROM print_list group by 1

   status   |  count
----------------+---------
 ERROR          |     159
 PREPARED       |   10162
 PRINTED        | 3551367
 TO_BE_PREPARED |       2
(4 rows)

>> We can also increase the 'Stats target' for this table, which will
>> cause the statistics to contain information about 'NOT_YET_PRINTED'
>> more often, but even then, it may not find any of these records, as
>> they sometimes do not exist.
>
> This is a better solution, IMHO.

We'll have a go at this, also if what you say about values having to
appear at least twice, the other values may make it into
most_common_*, which would make it clearer to us.

We're a bit hesitant to decrease random_page_cost (currently 3 in this
cluster) as a lot more is happening on this database.


pgsql-performance by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Index only scan sometimes switches to sequential scan for small amount of rows
Next
From: Feike Steenbergen
Date:
Subject: Re: Index only scan sometimes switches to sequential scan for small amount of rows