X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 39E2C92635C for ; Mon, 2 Jun 2003 02:15:05 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 95135-09 for ; Mon, 2 Jun 2003 02:14:54 -0400 (EDT) Received: from MAIL.nucleus.com (unknown [209.115.162.100]) by developer.postgresql.org (Postfix) with ESMTP id 1520F926359 for ; Mon, 2 Jun 2003 02:14:54 -0400 (EDT) Received: from dsl-mtryl-209-5-169-111-cgy.nucleus.com (unverified [209.5.169.111]) by MAIL.nucleus.com (Vircom SMTPRS 2.0.244) with ESMTP id ; Mon, 2 Jun 2003 00:14:46 -0600 From: "Andrew J. Kopciuch" Reply-To: akopciuch@bddf.ca Organization: BDDF Consulting To: "Erik G. Burrows" Subject: Re: SQL problem: bank account Date: Mon, 2 Jun 2003 00:13:39 -0600 User-Agent: KMail/1.5 References: <1054531815.13212.27.camel@griffin.jedi-group.com> In-Reply-To: <1054531815.13212.27.camel@griffin.jedi-group.com> Cc: pgsql-sql@postgresql.org X-MailKey: Flyers winning makes BDDF happy MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200306020013.39200.akopciuch@bddf.ca> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200306/12 X-Sequence-Number: 13770 > I need to get the most recent transaction for each customer. I need only > the transaction ID, but the entire row would be best. > Why don't you alter the customer table to hold the transaction ID of the most recent transaction? Some questions though: Do you vacuum the database regularly? Do you have any indexes created? Some things to think about. Andy