Re: Raw device on PostgreSQL - Mailing list pgsql-hackers

From Andreas Karlsson
Subject Re: Raw device on PostgreSQL
Date
Msg-id ff91bc22-2816-0137-7909-2c680d636099@proxel.se
Whole thread Raw
In response to Raw device on PostgreSQL  (Benjamin Schaller <benjamin.schaller@s2018.tu-chemnitz.de>)
Responses Re: Raw device on PostgreSQL  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Re: Raw device on PostgreSQL  ("Jonah H. Harris" <jonah.harris@gmail.com>)
List pgsql-hackers
On 4/28/20 10:43 AM, Benjamin Schaller wrote:
> for an university project I'm currently doing some research on 
> PostgreSQL. I was wondering if hypothetically it would be possible to 
> implement a raw device system to PostgreSQL. I know that the 
> disadvantages would probably be higher than the advantages compared to 
> working with the file system. Just hypothetically: Would it be possible 
> to change the source code of PostgreSQL so a raw device system could be 
> implemented, or would that cause a chain reaction so that basically one 
> would have to rewrite almost the entire code, because too many elements 
> of PostgreSQL rely on the file system?

It would require quite a bit of work since 1) PostgreSQL stores its data 
in multiple files and 2) PostgreSQL currently supports only synchronous 
buffered IO.

To get the performance benefits from using raw devices I think you would 
want to add support for asynchronous IO to PostgreSQL rather than 
implementing your own layer to emulate the kernel's buffered IO.

Andres Freund did a talk on aync IO in PostgreSQL earlier this year. It 
was not recorded but the slides are available.

https://www.postgresql.eu/events/fosdem2020/schedule/session/2959-asynchronous-io-for-postgresql/

Andreas



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Raw device on PostgreSQL
Next
From: Lőrinc Pap
Date:
Subject: Re: Binary COPY IN size reduction