pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
WAL reducing size
5+ messages / 4 participants
[nested] [flat]

* WAL reducing size
@ 2017-12-04 15:50 sql2pg <sekhar.career@gmail.com>
  2017-12-04 18:37 ` Re: WAL reducing size David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: sql2pg @ 2017-12-04 15:50 UTC (permalink / raw)
  To: pgsql-general

Is Postgres removes the committed transaction after archive.  LIke in SQL
Server , which removes the committed transactions after taking Log backup.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: WAL reducing size
  2017-12-04 15:50 WAL reducing size sql2pg <sekhar.career@gmail.com>
@ 2017-12-04 18:37 ` David G. Johnston <david.g.johnston@gmail.com>
  2017-12-04 21:05   ` Re: WAL reducing size sql2pg <sekhar.career@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2017-12-04 18:37 UTC (permalink / raw)
  To: sql2pg <sekhar.career@gmail.com>; +Cc: pgsql-general

On Mon, Dec 4, 2017 at 8:50 AM, sql2pg <sekhar.career@gmail.com> wrote:

> Is Postgres removes the committed transaction after archive.  LIke in SQL
> Server , which removes the committed transactions after taking Log backup.
>

If I understand correctly, yes - eventually.  The docs explain the behavior
and the configuration variables that control it.

https://www.postgresql.org/docs/10/static/wal-configuration.html

David J.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: WAL reducing size
  2017-12-04 15:50 WAL reducing size sql2pg <sekhar.career@gmail.com>
  2017-12-04 18:37 ` Re: WAL reducing size David G. Johnston <david.g.johnston@gmail.com>
@ 2017-12-04 21:05   ` sql2pg <sekhar.career@gmail.com>
  2017-12-04 21:12     ` Re: WAL reducing size Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 5+ messages in thread

From: sql2pg @ 2017-12-04 21:05 UTC (permalink / raw)
  To: pgsql-general

how about uncommitted(open transactions) .  if a segment has 1 committed and
2 uncommitted transactions then will it keep the segment instead deleting it
after checkpoint , since it has 2 uncommitted transactions 



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: WAL reducing size
  2017-12-04 15:50 WAL reducing size sql2pg <sekhar.career@gmail.com>
  2017-12-04 18:37 ` Re: WAL reducing size David G. Johnston <david.g.johnston@gmail.com>
  2017-12-04 21:05   ` Re: WAL reducing size sql2pg <sekhar.career@gmail.com>
@ 2017-12-04 21:12     ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  2017-12-05 02:20       ` Re: WAL reducing size Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Alvaro Herrera @ 2017-12-04 21:12 UTC (permalink / raw)
  To: sql2pg <sekhar.career@gmail.com>; +Cc: pgsql-general

sql2pg wrote:
> how about uncommitted(open transactions) .  if a segment has 1 committed and
> 2 uncommitted transactions then will it keep the segment instead deleting it
> after checkpoint , since it has 2 uncommitted transactions 

There is no connection between transaction commit and checkpoint
removing WAL files.  WAL files are removed after two checkpoints have
occured, regardless of transactions that might be open.  The on-disk
effects of those transactions that occured before the earlier checkpoint
are already on disk anyway.  The commit record might appear at whatever
point in the future, and the rows will not become visible to other
transactions until then, regardless of what happened to the WAL
segments.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: WAL reducing size
  2017-12-04 15:50 WAL reducing size sql2pg <sekhar.career@gmail.com>
  2017-12-04 18:37 ` Re: WAL reducing size David G. Johnston <david.g.johnston@gmail.com>
  2017-12-04 21:05   ` Re: WAL reducing size sql2pg <sekhar.career@gmail.com>
  2017-12-04 21:12     ` Re: WAL reducing size Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2017-12-05 02:20       ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2017-12-05 02:20 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: sql2pg <sekhar.career@gmail.com>; pgsql-general

On Tue, Dec 5, 2017 at 6:12 AM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> sql2pg wrote:
>> how about uncommitted(open transactions) .  if a segment has 1 committed and
>> 2 uncommitted transactions then will it keep the segment instead deleting it
>> after checkpoint , since it has 2 uncommitted transactions
>
> There is no connection between transaction commit and checkpoint
> removing WAL files.  WAL files are removed after two checkpoints have
> occured, regardless of transactions that might be open.  The on-disk
> effects of those transactions that occured before the earlier checkpoint
> are already on disk anyway.  The commit record might appear at whatever
> point in the future, and the rows will not become visible to other
> transactions until then, regardless of what happened to the WAL
> segments.

Something that perhaps does not concern you directly, but in Postgres
11 WAL segments get recycled after one completed checkpoint thanks to
commit 4b0d28d.
-- 
Michael




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2017-12-05 02:20 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 15:50 WAL reducing size sql2pg <sekhar.career@gmail.com>
2017-12-04 18:37 ` David G. Johnston <david.g.johnston@gmail.com>
2017-12-04 21:05   ` sql2pg <sekhar.career@gmail.com>
2017-12-04 21:12     ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2017-12-05 02:20       ` Michael Paquier <michael.paquier@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox