Re: Reduce/eliminate the impact of FPW

Поиск
Список
Период
Сортировка
От Daniel Wood
Тема Re: Reduce/eliminate the impact of FPW
Дата
Msg-id 2104390673.51233.1596477978015@connect.xfinity.com
обсуждение исходный текст
Ответ на Re: Reduce/eliminate the impact of FPW  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Reduce/eliminate the impact of FPW  (SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>)
Список pgsql-hackers
> On 08/03/2020 8:26 AM Robert Haas <robertmhaas@gmail.com> wrote:
...
> I think this is what's called a double-write buffer, or what was tried
> some years ago under that name.  A significant problem is that you
> have to fsync() the double-write buffer before you can write the WAL.

I don't think it does need to be fsync'ed before the WAL.  If the
log record has a FPW reference beyond the physical log EOF then we
don't need to restore the before image because we haven't yet did
the dirty page write from the cache.  The before image only needs
to be flushed before the dirty page write.  Usually this will have
already done.

> ... But for short transactions, such as those
> performed by pgbench, you'd probably end up with a lot of cases where
> you had to write 3 pages instead of 2, and not only that, but the
> writes have to be consecutive rather than simultaneous, and to
> different parts of the disk rather than sequential. That would likely
> suck a lot.

Wherever you write the before images, in the WAL or into a separate
file you would write the same number of pages.  I don't understand
the 3 pages vs 2 pages comment.

And, "different parts of the disk"???  I wouldn't enable the feature
on spinning media unless I had a dedicated disk for it.

NOTE:
If the 90's Informix called this the physical log.  Restoring at
crash time restored physical consistency after which redo/undo
recovery achieved logical consistency.  From their doc's:
    "If the before-image of a modified page is stored in the physical-log buffer, it is eventually flushed from the
physical-logbuffer to the physical log on disk. The before-image of the page plays a critical role in restoring data
andfast recovery. For more details, see Physical-Log Buffer."
 

> -- 
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: public schema default ACL
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: avoid bitmapOR-ing indexes with scan condition inconsistent with partition constraint