Skip site navigation (1) Skip section navigation (2)

Re: There's random access and then there's random access

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "pgsql-hackers list" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: There's random access and then there's random access
Date: 2007-12-04 17:46:23
Message-ID: 87ve7egxow.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
"Gregory Stark" <stark(at)enterprisedb(dot)com> writes:

> The two interfaces I'm aware of for this are posix_fadvise() and libaio.
> I've run tests with a synthetic benchmark which generates a large file then
> reads a random selection of blocks from within it using either synchronous
> reads like we do now or either of those interfaces. I saw impressive speed
> gains on a machine with only three drives in a raid array. I did this a
> while ago so I don't have the results handy. I'll rerun the tests again and
> post them.

Here's the results of running the synthetic test program on a 3-drive raid
array. Note that the results *exceeded* the 3x speedup I expected, even for
ordered blocks. Either the drive (or the OS) is capable of reordering the
block requests better than the offset into the file would appear or some other
effect is kicking in.

The test is with an 8GB file, picking 8,192 random 8k blocks from within it.
The pink diamonds represent the bandwidth obtained if the random blocks are
sorted before fetching (like a bitmap indexscan) and the blue if they're
unsorted.


Attachment: test-pfa.c
Description: text/x-csrc (8.9 KB)
Attachment: test-pfa-results
Description: application/octet-stream (2.2 KB)
Attachment: test-pfa-results.png
Description: image/png (15.2 KB) (inlined above)

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2007-12-04 17:46:38
Subject: Re: weird - invalid string enlargement request size
Previous:From: Walter CruzDate: 2007-12-04 17:18:36
Subject: weird - invalid string enlargement request size

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group