Hannu Krosing <hannu@tm.ee> writes:
> Or its solution ;) as instead of the predicting we just write all data
> in log that is ready to be written. If we postpone writing, there will
> be hickups when we suddenly discover that we need to write a whole lot
> of pages (fsync()) after idling the disk for some period.
This part is exactly the same point that I've been proposing to solve
with a background writer process. We don't need aio_write for that.
The background writer can handle pushing completed WAL pages out to
disk. The sticky part is trying to gang the writes for multiple
transactions whose COMMIT records would fit into the same WAL page,
and that WAL page isn't full yet.
The rest of what you wrote seems like wishful thinking about how
aio_write might behave :-(. I have no faith in it.
regards, tom lane