Re: There's random access and then there's random access - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: There's random access and then there's random access
Date
Msg-id 87ve7egxow.fsf@oxford.xeocode.com
Whole thread Raw
In response to There's random access and then there's random access  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: There's random access and then there's random access  (Mark Mielke <mark@mark.mielke.cc>)
List pgsql-hackers
"Gregory Stark" <stark@enterprisedb.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.




for i in 1 2 3 4 5 6 7 8 16 24 32 64 96 128 192 256 384 512 768 1024 2048 4096 8192 ; do
  ./a.out pfa2 /mnt/data/test.data 8388608 8192 $i 8192 false ;
done >> test-pfa-results

for i in 1 2 3 4 5 6 7 8 16 24 32 64 96 128 192 256 384 512 768 1024 2048 4096 8192 ; do
  ./a.out pfa2 /mnt/data/test.data 8388608 8192 $i 8192 true ;
done >> test-pfa-results




--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

Attachment

pgsql-hackers by date:

Previous
From: "Walter Cruz"
Date:
Subject: weird - invalid string enlargement request size
Next
From: Alvaro Herrera
Date:
Subject: Re: weird - invalid string enlargement request size