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

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: (view raw, whole thread or download thread mbox)
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.

Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB:        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 yet?

In response to

pgsql-novice by date

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

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