A doubt w.r.t WAL

Started by Shridhar Daithankarover 22 years ago3 messagesgeneral
Jump to latest
#1Shridhar Daithankar
shridhar_daithankar@persistent.co.in

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Shridhar Daithankar (#1)
Re: A doubt w.r.t WAL

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

#3Lincoln Yeoh
lyeoh@pop.jaring.my
In reply to: Tom Lane (#2)
Re: A doubt w.r.t WAL

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:

Show quoted text

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