Re: [GENERAL] medical image on postgreSQL? - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [GENERAL] medical image on postgreSQL?
Date
Msg-id 87wui0prc4.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: [GENERAL] medical image on postgreSQL?  (Sean Chittenden <sean@chittenden.org>)
Responses Re: [GENERAL] medical image on postgreSQL?  (Sean Chittenden <sean@chittenden.org>)
List pgsql-hackers
Sean Chittenden <sean@chittenden.org> writes:

> Other zero copy socket operations are mmap() + write(), but last I heard,
> that was a FreeBSD only thing... for now. man 2 sendfile

There's a lot of resistance to the optimizating mmap+write in the linux camp.
It isn't just a matter of time, the developers there actively think this is a
bad idea. In fact the code has been written several times and is never
accepted. They think developers should be encouraged to use sendfile and the
common code path for write shouldn't be wasting cycles checking for  special
cases in the page table.

Note that there are some protocol requirements for sendfile to be feasible.
There has to be zero alterations made to the data in flight. No escaping,
decompression, etc. And there has to be no cases when the program would want
to stop transmitting partway through. I think you can send a portion of a file
but you would have to know the size of the chunk up front and the best
performance would be if the chunk is very large.

--
greg



pgsql-hackers by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: How do you execute a postgresql function from perl?
Next
From: David Blasby
Date:
Subject: backend dies when C function calls C++ library that throws an exception