X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6F04E5288E for ; Sun, 22 May 2005 06:02:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40426-03 for ; Sun, 22 May 2005 09:02:40 +0000 (GMT) Received: from nproxy.gmail.com (unknown [64.233.182.197]) by svr1.postgresql.org (Postfix) with ESMTP id 7EF7D5288B for ; Sun, 22 May 2005 06:02:38 -0300 (ADT) Received: by nproxy.gmail.com with SMTP id g2so17709nfe for ; Sun, 22 May 2005 02:03:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=r9ycP+G4hdEnk3g1PcLbQeIpDrFfAuDxMatmBL11IPVxEEwzuHltSHLPaXCDn3DSi8lJqWA8srJTd1xdkL4mBXUiZDNeW19i0atX1tbgLUGxdqXcDCYBBENpSaBheLXvK5i2aMD5owYvvld6gq1LItGSbw6/K1tKhaaxEnLLTmM= Received: by 10.48.4.14 with SMTP id 14mr6716nfd; Sun, 22 May 2005 02:03:19 -0700 (PDT) Received: by 10.48.240.2 with HTTP; Sun, 22 May 2005 02:03:19 -0700 (PDT) Message-ID: <42d8505e0505220203bd3cb94@mail.gmail.com> Date: Sun, 22 May 2005 11:03:19 +0200 From: LAMBEAU Bernard Reply-To: blambeau@chefbe.net To: Andreas Kretschmer , pgsql-sql@postgresql.org Subject: Re: [despammed] Balance Calculation In-Reply-To: <20050522084250.GA5579@webserv.wug-glas.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <033001c55e85$1801a730$1f00a8c0@middinks> <20050522081753.GA5136@webserv.wug-glas.de> <20050522084250.GA5579@webserv.wug-glas.de> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.304 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/178 X-Sequence-Number: 21491 Do you tried to create an index on the account column ? I think it may help. Regards ---------------------------------------------------------------------------= ---------- Bernard LAMBEAU D=E9partement d'Ing=E9nierie Informatique Universit=E9 Catholique de Louvain-La-Neuve (Belgium) On 5/22/05, Andreas Kretschmer wrote: > am 22.05.2005, um 10:17:53 +0200 mailte Andreas Kretschmer folgendes: > > > can you help me how to fix them. > > > Can I using function to fix them (how?) > > > > It is possible to create a extra table for the balance and a trigger fo= r > > insert/update that calculates the balance for the transactions-table? > > > > > > I think, this should solve your perfomance-problem. >=20 > Sorry, this is not the solution for your problem, because this provide > only the actual balance for a single account, but not the history. >=20 > Mmh... >=20 > A extra table with the oid and the balance for every row in > transactions. Then you can do a index scan, but you need also a trigger > that insert every transaction in this table and calculate the balance. >=20 >=20 >=20 >=20 > Regards > -- > Andreas Kretschmer (Kontakt: siehe Header) > Heynitz: 035242/47212, D1: 0160/7141639 > GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net > =3D=3D=3D Schollglas Unternehmensgruppe =3D=3D=3D >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >