Обсуждение: A doubt w.r.t WAL

Поиск
Список
Период
Сортировка

A doubt w.r.t WAL

От
Shridhar Daithankar
Дата:
Hi,

I have a doubt regarding WAL.

Let's say I have only one wAL segment of 16MB and in a single transaction I
put 20MB of data, say a text file dump inside a transaction.

How does WAL handles this situation from POV of using/reusing WAL space and
ensuring consistency of data in table?

Does it record committed/uncommitted transaction id in clog and safely start
pushing data into data files?

 Shridhar



Re: A doubt w.r.t WAL

От
Tom Lane
Дата:
Shridhar Daithankar <shridhar_daithankar@persistent.co.in> writes:
> Let's say I have only one wAL segment of 16MB and in a single transaction I
> put 20MB of data, say a text file dump inside a transaction.

AFAIR you cannot force the system to have only one WAL segment; it
*will* make another one when it has to.

Once it has established a checkpoint within the current WAL segment,
it is able to delete the previous segment, and will do so if you've
set the WAL parameters that small.  I don't really recommend doing
so however.  Creating and deleting WAL segments is expensive, and not
very productive compared to recycling them.  The out-of-the-box
settings allow the system to recycle three or so WAL segments.
Unless you're truly desperate for disk space you should not reduce
the default WAL settings.

            regards, tom lane

Re: A doubt w.r.t WAL

От
Lincoln Yeoh
Дата:
If I'm doing a reasonably sized COPY e.g. a few hundred megabytes, would
WAL segment size and number be relevant? If so any pointers on how I should
tweak stuff?

How about for speeding up many inserts?

At 12:13 AM 7/22/2003 -0400, Tom Lane wrote:

>AFAIR you cannot force the system to have only one WAL segment; it
>*will* make another one when it has to.
>
>Once it has established a checkpoint within the current WAL segment,
>it is able to delete the previous segment, and will do so if you've
>set the WAL parameters that small.  I don't really recommend doing
>so however.  Creating and deleting WAL segments is expensive, and not
>very productive compared to recycling them.  The out-of-the-box
>settings allow the system to recycle three or so WAL segments.
>Unless you're truly desperate for disk space you should not reduce
>the default WAL settings.
>
>                         regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings