Re: How efficient are Views

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
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-13 12:46:05
Message-ID: 1023972365.19800.354.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-novice

On Thu, 2002-06-13 at 03:02, John Taylor wrote:
> Hi,
>
> 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.
>
> Are views generated for every access ?
> Are they generated when the underlying data changes ?
>
> Whould it maybe be faster to have a seperate table alongside the base data, and
> generate it via a trigger or stored procedure ?

It depends on your ratio of queries to inserts. It depends on the size
of your tables and the indexing that you have on them. It depends on
whether your queries are on subsets or summaries.

On the other hand, there is no reason why queries should necessarily be
slow 'once you have a large amount of data loaded' - that depends on a
lot more database choices than just whether you use a view.

Regards,
Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Are you enrolled at http://schoolreunions.co.nz/ yet?

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Dave Cramer 2002-06-13 14:44:46 Re: Shouldn't "aborted transaction" be an ERROR? (was Re:
Previous Message Manfred Koizar 2002-06-12 18:14:13 Re: Optimising inside transactions