Re: query help/sugestions

From: Roberto Mello <rmello(at)cc(dot)usu(dot)edu>
To: John Cavacas <oogly(at)rogers(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: query help/sugestions
Date: 2003-02-08 16:38:55
Message-ID: 20030208163855.GD25254@cc.usu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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"

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message John Cavacas 2003-02-08 17:27:34 Re: query help/sugestions
Previous Message Hanan Hotmail 2003-02-08 16:23:57 Design question: How to convert a given data structure to sql and the opposite.