X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DC2BED1B4A6 for ; Thu, 4 Dec 2003 21:37:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 28408-09 for ; Thu, 4 Dec 2003 17:37:13 -0400 (AST) Received: from yertle.kcilink.com (yertle.kcilink.com [216.194.193.105]) by svr1.postgresql.org (Postfix) with ESMTP id 0FDDCD1B484 for ; Thu, 4 Dec 2003 17:37:11 -0400 (AST) Received: by yertle.kcilink.com (Postfix, from userid 100) id 5D1622178A; Thu, 4 Dec 2003 16:37:12 -0500 (EST) From: Vivek Khera MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16335.43272.273411.653445@yertle.int.kciLink.com> Date: Thu, 4 Dec 2003 16:37:12 -0500 To: pgsql-performance@postgresql.org Subject: Re: autovacuum daemon stops doing work after about an 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> <2348.66.106.27.14.1070571171.squirrel@matth.zeut.net> <16335.42262.196435.193875@yertle.int.kciLink.com> <401840000.1070573136@lerlaptop-red.iadfw.net> X-Mailer: VM 7.17 under 21.4 (patch 14) "Reasonable Discussion" XEmacs Lucid X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/104 X-Sequence-Number: 4964 >>>>> "LR" == Larry Rosenman 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.