X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 25C64475C26 for ; Sat, 8 Feb 2003 11:32:21 -0500 (EST) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.227.56]) by postgresql.org (Postfix) with ESMTP id 39449475C45 for ; Sat, 8 Feb 2003 11:31:53 -0500 (EST) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 18hY0F-0006lu-00; Sat, 08 Feb 2003 09:38:55 -0700 Date: Sat, 8 Feb 2003 09:38:55 -0700 From: Roberto Mello To: John Cavacas Cc: pgsql-sql@postgresql.org Subject: Re: query help/sugestions Message-ID: <20030208163855.GD25254@cc.usu.edu> References: <001501c2cf35$f7584a10$6401a8c0@spook> <20030208063539.GA20208@cc.usu.edu> <002a01c2cf44$71948600$6401a8c0@spook> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <002a01c2cf44$71948600$6401a8c0@spook> User-Agent: Mutt/1.4i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/171 X-Sequence-Number: 11569 On Sat, Feb 08, 2003 at 02:33:58AM -0500, John Cavacas wrote: > > CREATE VIEW viewcontent > (id,statusid,title,datecreated,lastmodified,userid,username,catid,catego > ry,intro,body,typeid,content,commentcount) as > > SELECT a.id as id, > a.status as statusid, > a.title as title, > a.datecreated as datecreated, ... Have you run the query above under EXPLAIN to see what kind of execution plan you're getting? > Is creating the view a good idea in terms of performance? This is a > general query, I would for example not include the main body of the text > needed for the front page listing. The performance will be as good as your underlying query is. The VIEW is just an "alias" if you will, and they are generally a good idea. -Roberto P.S.: Please trim the messages to which you respond. For this message you left dozens of lines of cruft hanging after your message (replying at the top is a bad idea too, because you lose context). Not only this is bad for the archives, but it wastes bandwidth and shows lack of respect for other people's inbox. -- +----| Roberto Mello - http://www.brasileiro.net/ |------+ + Computer Science Graduate Student, Utah State University + + USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ + Boss spelled backwards is "double-SOB"