Re: [PATCH] Prefetch index pages for B-Tree index scans - Mailing list pgsql-hackers

From John Lumby
Subject Re: [PATCH] Prefetch index pages for B-Tree index scans
Date
Msg-id COL116-W27CCF26B2D4D859F192289A36B0@phx.gbl
Whole thread Raw
In response to Re: [PATCH] Prefetch index pages for B-Tree index scans  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian wrote:
>
> On Fri, Nov 2, 2012 at 09:59:08AM -0400, John Lumby wrote:
> > However,    the OP describes an implementation based on libaio.
> > Today what we have (for linux) is librt,  which is quite different.
>
> Well, good thing we didn't switch to using libaio, now that it is gone.
>
Yes,  I think you are correct.    Although I should correct myself about
status of libaio -  it seems many distros continue to provide it and at least
one other popular database (MySQL) uses it,   but as far as I can tell
the content has not been updated by the original authors for around 10 years.
That is perhaps not surprising since it does very little other than wrap
the linux kernel syscalls.

Set against the CPU-overhead disadvantage of librt,  I think the three
main advantages of librt vs libaio/kernel-aio for postgresql are :
  .   posix standard,  and probably easier to provide very similar
      implementation on windows  (I see at least one posix aio lib for windows)
  .   no restrictions on the way files are accessed  (kernel-aio imposes restrictions
      on open() flags and buffer alignment etc)
  .   it seems (from the recent postings about the earlier attempt to implement
      async io using libaio) that the posix threads style lends itself better to
      fitting in with the postgresql backend model.

John



pgsql-hackers by date:

Previous
From: "md@rpzdesign.com"
Date:
Subject: File Corruption recovery
Next
From: Tom Lane
Date:
Subject: Re: Arguments to foreign tables?