Re: [HACKERS] Proposal : For Auto-Prewarm. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] Proposal : For Auto-Prewarm.
Date
Msg-id CAA4eK1JL9cCqtLFKPstW+O=kWT60fA8QRkPaEPm0JJ2xPVhU-g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Proposal : For Auto-Prewarm.  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Proposal : For Auto-Prewarm.
List pgsql-hackers
On Fri, Jun 23, 2017 at 3:22 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Thu, Jun 15, 2017 at 12:35 AM, Mithun Cy <mithun.cy@enterprisedb.com> wrote:
>
> * Instead of creating our own buffering system via buffer_file_write()
> and buffer_file_flush(), why not just use the facilities provided by
> the operating system?  fopen() et. al. provide buffering, and we have
> AllocateFile() to provide a FILE *; it's just like
> OpenTransientFile(), which you are using, but you'll get the buffering
> stuff for free.  Maybe there's some reason why this won't work out
> nicely, but off-hand it seems like it might.  It looks like you are
> already using AllocateFile() to read the dump, so using it to write
> the dump as well seems like it would be logical.
>

One thing that is worth considering is AllocateFile is recommended to
be used for short operations.  Refer text atop AllocateFile().  If the
number of blocks to be dumped is large, then the file can remain open
for the significant period of time.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Proposal : For Auto-Prewarm.
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] hash index on unlogged tables doesn't behave as expected