Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: Sequences -...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 7 Topic 3074 of 3322
Post > Topic >>

Re: Sequences - jumped after power failure

by steve@[EMAIL PROTECTED] (Steve T) Apr 15, 2008 at 06:04 PM

--=-YsNal5V5oYdpyoNzGjn+
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Cheers Tom.
I'll note that down under the section '...things to note should the
server crash...' - just under the note that says '...get a UPS...'

On Tue, 2008-04-15 at 10:58 -0400, Tom Lane wrote:

> Steve T <steve@[EMAIL PROTECTED]
> writes:
> > I have a set of claims tables that cover the claim itself, the
customer,
> > contact points etc. Yesterday there was a power failure and the server
> > suffered an immediate power outage. When the server came back,
> > everything seemed fine, apart from the fact that the claim related
> > sequences had all jumped and left a gap of 33 (last was 52 before
power
> > failure, next one allocated after power failure 85). This seems
> > consistent across all the tables related to the claim (it may be
across
> > the   tables in the database - I haven't checked all of them as yet).
> 
> > Does this sound feasible and if so, what is the cause?
> 
> Yeah, this is intentional behavior designed to reduce the amount of disk
> write traffic generated by nextval()s.  From a standing start, a
> nextval() actually advances the sequence 33 times (1 + SEQ_LOG_VALS),
> so that the next 32 nextval()s won't need to generate their own WAL
> records.  I guess you must have crashed before that first nextval()
> was able to commit its result into the database ...
> 
> 			regards, tom lane



Steve Tucknott
ReTSol Ltd

DDI:         01323 488548
Mobile:     0773 671 5772

--=-YsNal5V5oYdpyoNzGjn+
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.12.3">
</HEAD>
<BODY>
Cheers Tom.<BR>
I'll note that down under the section '...things to note should the server
crash...' - just under the note that says '...get a UPS...'<BR>
<BR>
On Tue, 2008-04-15 at 10:58 -0400, Tom Lane wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Steve T &lt;<A
HREF="mailto:steve@[EMAIL PROTECTED]
">steve@[EMAIL PROTECTED]
>&gt; writes:</FONT>
<FONT COLOR="#000000">&gt; I have a set of claims tables that cover the
claim itself, the customer,</FONT>
<FONT COLOR="#000000">&gt; contact points etc. Yesterday there was a power
failure and the server</FONT>
<FONT COLOR="#000000">&gt; suffered an immediate power outage. When the
server came back,</FONT>
<FONT COLOR="#000000">&gt; everything seemed fine, apart from the fact
that the claim related</FONT>
<FONT COLOR="#000000">&gt; sequences had all jumped and left a gap of 33
(last was 52 before power</FONT>
<FONT COLOR="#000000">&gt; failure, next one allocated after power failure
85). This seems</FONT>
<FONT COLOR="#000000">&gt; consistent across all the tables related to the
claim (it may be across</FONT>
<FONT COLOR="#000000">&gt; the   tables in the database - I haven't
checked all of them as yet).</FONT>

<FONT COLOR="#000000">&gt; Does this sound feasible and if so, what is the
cause?</FONT>

<FONT COLOR="#000000">Yeah, this is intentional behavior designed to
reduce the amount of disk</FONT>
<FONT COLOR="#000000">write traffic generated by nextval()s.  From a
standing start, a</FONT>
<FONT COLOR="#000000">nextval() actually advances the sequence 33 times (1
+ SEQ_LOG_VALS),</FONT>
<FONT COLOR="#000000">so that the next 32 nextval()s won't need to
generate their own WAL</FONT>
<FONT COLOR="#000000">records.  I guess you must have crashed before that
first nextval()</FONT>
<FONT COLOR="#000000">was able to commit its result into the database
...</FONT>

<FONT COLOR="#000000">			regards, tom lane</FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<BR>
<B><I><FONT COLOR="#003366">Steve Tucknott</FONT></I></B><BR>
<B><I><FONT COLOR="#ff0000">R</FONT></I></B><B><I><FONT
COLOR="#ff6600">e</FONT></I></B><B><I><FONT
COLOR="#ffcc00">TS</FONT></I></B><B><I><FONT
COLOR="#ff6600">o</FONT></I></B><B><I><FONT COLOR="#ff0000">l
</FONT></I></B><B><I><FONT COLOR="#800000">Ltd</FONT></I></B><BR>
<BR>
<B><I><FONT
COLOR="#003366">DDI:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 01323
488548</FONT></I></B><BR>
<B><I><FONT COLOR="#003366">Mobile:&nbsp;&nbsp;&nbsp;&nbsp; 0773 671
5772</FONT></I></B>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-YsNal5V5oYdpyoNzGjn+--
 




 7 Posts in Topic:
Sequences - jumped after power failure
steve@[EMAIL PROTECTED]   2008-04-15 09:21:05 
Re: Sequences - jumped after power failure
sdavis2@[EMAIL PROTECTED]  2008-04-15 05:47:33 
Re: Sequences - jumped after power failure
steve@[EMAIL PROTECTED]   2008-04-15 11:07:18 
Re: Sequences - jumped after power failure
nobs@[EMAIL PROTECTED] (  2008-04-15 12:50:49 
Re: Sequences - jumped after power failure
tgl@[EMAIL PROTECTED] (T  2008-04-15 10:58:17 
Re: Sequences - jumped after power failure
steve@[EMAIL PROTECTED]   2008-04-15 16:51:51 
Re: Sequences - jumped after power failure
steve@[EMAIL PROTECTED]   2008-04-15 18:04:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 4:36:55 CST 2008.