Re: Slow count(*) again...

From: Scott Carey <scott(at)richrelevance(dot)com>
To: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, Joshua Tolley <eggyknap(at)gmail(dot)com>, Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, "mladen(dot)gogala(at)vmsinfo(dot)com" <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 04:06:07
Message-ID: E2D86063-1FD0-48D0-BB0D-0E78F4A77FD2@richrelevance.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

I can't speak to documentation, but it is something that helps as your I/O subsystem gets more powerful, and how much it helps depends more on your hardware, which may have adaptive read ahead on its own, and your file system which may be more or less efficient at sequential I/O. For example ext3 out of the box gets a much bigger gain from tuning read-ahead than XFS on a DELL PERC6 RAID card (but still ends up slower).

Linux Read-ahead has no effect on random access performance. A workload consisting of mixed sequential scans and random reads can be tuned to favor one over the other based on a combination of the I/O scheduler used and the ammount of read-ahead. Larger read-ahead helps sequential scans, and the Deadline scheduler tends to favor throughput (sequential scans) over latency (random access) compared to the cfq scheduler.

On Oct 11, 2010, at 8:58 PM, Samuel Gendler wrote:

On Mon, Oct 11, 2010 at 7:19 PM, Greg Smith <greg(at)2ndquadrant(dot)com<mailto:greg(at)2ndquadrant(dot)com>> wrote:

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.

I spent some time going through the various tuning docs on the wiki whie bringing some new hardware up and I can't remember seeing any discussion of tweaking read-ahead at all in the normal performance-tuning references. Do you have any documentation of the kinds of tweaking you have done and its effects on different types of workloads?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Samuel Gendler 2010-10-12 04:21:59 Re: Slow count(*) again...
Previous Message Samuel Gendler 2010-10-12 03:58:45 Re: Slow count(*) again...

Browse pgsql-performance by date

  From Date Subject
Next Message Samuel Gendler 2010-10-12 04:21:59 Re: Slow count(*) again...
Previous Message Samuel Gendler 2010-10-12 03:58:45 Re: Slow count(*) again...