From: Roberto Mello <rmello@cc.usu.edu>
To: John Cavacas <oogly@rogers.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: query help/sugestions
Date: Sat, 8 Feb 2003 09:38:55 -0700
Message-ID: <20030208163855.GD25254@cc.usu.edu> (raw)
In-Reply-To: <002a01c2cf44$71948600$6401a8c0@spook>
References: <001501c2cf35$f7584a10$6401a8c0@spook>
<20030208063539.GA20208@cc.usu.edu>
<002a01c2cf44$71948600$6401a8c0@spook>
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"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rmello@cc.usu.edu, oogly@rogers.com
Subject: Re: query help/sugestions
In-Reply-To: <20030208163855.GD25254@cc.usu.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox