Skip site navigation (1) Skip section navigation (2)

Re: How efficient are Views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Taylor <postgres(at)jtresponse(dot)co(dot)uk>
Cc: "PgSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How efficient are Views
Date: 2002-06-12 15:31:49
Message-ID: 10056.1023895909@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
John Taylor <postgres(at)jtresponse(dot)co(dot)uk> writes:
> I'm thinking about using a view for my application.

> However, I'm wondering about how efficient it will be once I have a
> large amount of data loaded.

Views are effectively just query macros --- Postgres doesn't have any
notion of pre-materialized views.

Whether this will be efficient or not depends very much on what the
intended view is and how you use it.

> Whould it maybe be faster to have a seperate table alongside the base
> data, and generate it via a trigger or stored procedure ?

You could do that, and in some cases it'd be helpful; in other cases
it'd be a big loss.  Without any details on your scenario, we really
can't say more than that.  What's the proposed view?  How often will
you access the view as compared to modifying the underlying table?

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2002-06-12 15:36:30
Subject: Re: Optimising inside transactions
Previous:From: Henshall, Stuart - WCPDate: 2002-06-12 15:24:40
Subject: Re: Optimising inside transactions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group