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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, thanks for having a look and thinking with us

On 25 March 2015 at 13:45, Tomas Vondra <tomas.vondra@xxxxxxxxxxxxxxx> 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.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux