pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vivek Khera <khera@kcilink.com>
To: pgsql-performance@postgresql.org
Subject: Re: autovacuum daemon stops doing work after about an
Date: Thu, 4 Dec 2003 16:37:12 -0500
Message-ID: <16335.43272.273411.653445@yertle.int.kciLink.com> (raw)
In-Reply-To: <401840000.1070573136@lerlaptop-red.iadfw.net>
References: <16332.63508.196365.801418@yertle.int.kciLink.com>
	<1070516326.1455.11.camel@zedora.zeut.net>
	<x7wu9cid06.fsf@yertle.int.kciLink.com>
	<2348.66.106.27.14.1070571171.squirrel@matth.zeut.net>
	<16335.42262.196435.193875@yertle.int.kciLink.com>
	<401840000.1070573136@lerlaptop-red.iadfw.net>

>>>>> "LR" == Larry Rosenman <ler@lerctr.org> writes:

>> I'd be curious to see the output of this program on other platforms
>> and other compilers.  I'm using gcc 2.95.4 as shipped with FreeBSD
>> 4.8+.
LR> this is with the UnixWare compiler:
LR> $ cc -O -o testvk testvk.c
LR> $ ./testvk
LR> seconds = 3509
LR> seconds1 = 3509000000
LR> useconds = -452486
LR> stepped diff = 3508547514
LR> seconds2 = -785967296
LR> seconds3 = 3509000000
LR> diff = -786419782
LR> long long diff = 3508547514
LR> $

LR> I think this is a C bug.

Upon further reflection, I think so to.  The entire RHS is long's so
the arithmetic is done in longs, then assigned to a long long when
done (after things have overflowed).  Forcing any one of the RHS
values to be long long causes the arithmetic to all be done using long
longs, and then you get the numbers you expect.

I think you only notice this in autovacuum when it takes a long time
to complete the work, like my example of about 3500 seconds.



view thread (16+ messages)  latest in thread

Message-ID: <16335.43272.273411.653445@yertle.int.kciLink.com>
Permalink:  ../16335.43272.273411.653445@yertle.int.kciLink.com/
Also on:    postgresql.org/message-id/16335.43272.273411.653445@yertle.int.kciLink.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: khera@kcilink.com
  Subject: Re: autovacuum daemon stops doing work after about an
  In-Reply-To: <16335.43272.273411.653445@yertle.int.kciLink.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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