Re: autovacuum daemon stops doing work after about an

From: Vivek Khera <khera(at)kcilink(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: autovacuum daemon stops doing work after about an
Date: 2003-12-04 21:37:12
Message-ID: 16335.43272.273411.653445@yertle.int.kciLink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

>>>>> "LR" == Larry Rosenman <ler(at)lerctr(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ray Aspeitia 2003-12-04 21:46:16 7.4 include file conflict
Previous Message Larry Rosenman 2003-12-04 21:25:36 Re: autovacuum daemon stops doing work after about an

Browse pgsql-performance by date

  From Date Subject
Next Message Ivar Zarans 2003-12-04 22:13:12 Re: Slow UPADTE, compared to INSERT
Previous Message Larry Rosenman 2003-12-04 21:25:36 Re: autovacuum daemon stops doing work after about an