Re: Slow count(*) again...

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Joshua Tolley <eggyknap(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, mladen(dot)gogala(at)vmsinfo(dot)com, Neil Whelchel <neil(dot)whelchel(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow count(*) again...
Date: 2010-10-12 02:19:04
Message-ID: 4CB3C598.2010302@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Joshua Tolley wrote:
> It was asserted that reading bigger chunks would help performance; a response
> suggested that, at least in Linux, setting readahead on a device would
> essentially do the same thing. Or that's what I got from the thread, anyway.
> I'm interested to know how similar performance might be between the large
> block size case and the large readahead case.

Large read-ahead addresses the complaint here (bulk reads are slow) just
fine, which is one reason why this whole topic isn't nearly as
interesting as claimed. Larger chunk sizes in theory will do the same
thing, but then you're guaranteed to be reading larger blocks than
necessary in all cases. The nice thing about a good adaptive read-ahead
is that it can target small blocks normally, and only kick into heavy
read-ahead mode when the I/O pattern justifies it.

This is a problem for the operating system to solve, and such solutions
out there are already good enough that PostgreSQL has little reason to
try and innovate in this area. I routinely see seq scan throughput
double on Linux just by tweaking read-ahead from the tiny defaults to a
sane value.

--
Greg Smith, 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services and Support www.2ndQuadrant.us
Author, "PostgreSQL 9.0 High Performance" Pre-ordering at:
https://www.packtpub.com/postgresql-9-0-high-performance/book

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Carey 2010-10-12 02:21:04 Re: Slow count(*) again...
Previous Message Gurjeet Singh 2010-10-12 02:17:10 Re: Issues with two-server Synch Rep

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2010-10-12 02:21:04 Re: Slow count(*) again...
Previous Message Scott Carey 2010-10-12 02:02:51 Re: Slow count(*) again...