Re: Index only scan sometimes switches to sequential scan for small amount of rows

From: Feike Steenbergen <feikesteenbergen(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Index only scan sometimes switches to sequential scan for small amount of rows
Date: 2015-03-25 14:22:33
Message-ID: CAK_s-G0O4VK-J-9BQtShU1_Osr3NG1_T7VDDXRniXTd9VYPdHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi, thanks for having a look and thinking with us

On 25 March 2015 at 13:45, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Feike Steenbergen 2015-03-25 16:07:13 Re: Index only scan sometimes switches to sequential scan for small amount of rows
Previous Message Tomas Vondra 2015-03-25 12:45:06 Re: Index only scan sometimes switches to sequential scan for small amount of rows