pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Craig Ringer <craig@postnewspapers.com.au>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Slow count(*) again...
Date: Wed, 13 Oct 2010 19:42:00 +0800
Message-ID: <4CB59B08.6030900@postnewspapers.com.au> (raw )
In-Reply-To: <4CB48EF4.5030502@krogh.cc >
References: <201010091626.18636.neil.whelchel@gmail.com >
<4CB11CC7.8070300@vmsinfo.com >
<4CB167CA.9070109@postnewspapers.com.au >
<4CB1F46E.80205@vmsinfo.com >
<4CB2410C.6010603@postnewspapers.com.au >
<4cb25a0e.2a978e0a.7797.33d6@mx.google.com >
<4CB3C598.2010302@2ndquadrant.com >
<AANLkTi=WE-CsGVC3j4CX9ddGGsRZ3Mmk6aJGKk4NT=g6@mail.gmail.com >
<E2D86063-1FD0-48D0-BB0D-0E78F4A77FD2@richrelevance.com >
<AANLkTimjsbV6W5JcMKs02b1wJLhhXaxHxq7=mURY50nG@mail.gmail.com >
<0CA660FA-F59C-494E-BFA9-98CE8E527378@richrelevance.com >
<4CB48EF4.5030502@krogh.cc >
On 13/10/2010 12:38 AM, Jesper Krogh wrote:
> If some clever postgres hacker could teach postgres to allocate blocks
> using posix_fallocate in quite large batches, say .. something like:
> fallocate(min(current_relation_size *0.1,1073741824))
There doesn't seem to be any use of posix_fallocate in the sources, at
least according to git grep. The patch that introduced posix_fadvise use
apparently had posix_fallocate in it, but that use appears to have been
removed down the track.
It's worth noting that posix_fallocate sucks if your file system doesn't
intelligent support for it. IIRC it's horrible on ext3, where it can
take a while to return while it allocates (and IIRC zeroes!) all those
blocks. This may be part of why it's not used. In past testing with
posix_fallocate for other tools I've also found rather mixed performance
results - it can slow things down rather than speed them up, depending
on the file system in use and all sorts of other factors.
If Pg was to use posix_fallocate, it'd probably need control over it on
a per-tablespace basis.
--
Craig Ringer
Tech-related writing at http://soapyfrogs.blogspot.com/
view thread (246+ messages) latest in thread
Message-ID: <4CB59B08.6030900@postnewspapers.com.au>
Permalink: ../4CB59B08.6030900@postnewspapers.com.au/
Also on: postgresql.org/message-id/4CB59B08.6030900@postnewspapers.com.au
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: craig@postnewspapers.com.au
Subject: Re: Slow count(*) again...
In-Reply-To: <4CB59B08.6030900@postnewspapers.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox