Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 21FA19FB435 for ; Thu, 26 Jul 2007 11:49:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 68113-10 for ; Thu, 26 Jul 2007 11:49:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by postgresql.org (Postfix) with ESMTP id 662C39FB9D6 for ; Thu, 26 Jul 2007 11:49:08 -0300 (ADT) Received: from vanquish.pitbpa0.priv.collaborativefusion.com (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTP id 42D6FEBC78; Thu, 26 Jul 2007 10:49:06 -0400 (EDT) Date: Thu, 26 Jul 2007 10:49:05 -0400 From: Bill Moran To: Ranieri Mazili Cc: pgsql-general@postgresql.org Subject: Re: Tunning PostgreSQL performance for views on Windows Message-Id: <20070726104905.e7980368.wmoran@potentialtech.com> In-Reply-To: <46A8AF1B.4090607@terra.com.br> References: <46A8AF1B.4090607@terra.com.br> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.11; i386-portbld-freebsd6.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/1079 X-Sequence-Number: 117680 In response to Ranieri Mazili : > > I'm developing a BI and as database it's using postgresql 8.2, how data > are very detailed, I'm creating a view to consolidate the most important > data, but the performance of view is very poor, 1 minute to perform more > or less without where clause. > I need to know how I can increase the performance, if exist some option > to do cache, because the view will change only one time per day. > My configuration is default, without modifications after install. > I'm using windows 2003 server with a dell server with 4GB of memory. Standard tuning advice would apply, as well as the advice not to cross- post. Also boilerplate advice that we can't really help much without more detail. Good places to start with tuning: http://www.powerpostgresql.com/PerfList http://www.varlena.com/GeneralBits/Tidbits/perf.html However, if the data only changes once a day, you may be better of materializing the data, instead of using a view. Run a cron job once a day that does your big query and stores the data in another table vi SELECT INTO might be better for you than a view. > To create the view, I created some functions, and then perform they on > one select like: > select A.field1, B.field2, ... from function_A() A, function_B() B... > Is this the best way to do it? > > I appreciate any help. > > Thanks > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster -- Bill Moran http://www.potentialtech.com