pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
View Vs. Table
2+ messages / 2 participants
[nested] [flat]

* View Vs. Table
@ 2007-03-06 14:32 Radhika Sambamurti <sushi@88thstreet.com>
  2007-03-09 15:01 ` Re: View Vs. Table Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 2+ messages in thread

From: Radhika Sambamurti @ 2007-03-06 14:32 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I have two tables which currently are being aggregated into a third table.
I am proposing eliminating or drastically shortening the 3rd aggregation
table, and instead just using a View.

Which brings me to the question, which is better? Reading from a table or
a view or is there a difference in performance?



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: View Vs. Table
  2007-03-06 14:32 View Vs. Table Radhika Sambamurti <sushi@88thstreet.com>
@ 2007-03-09 15:01 ` Bruno Wolff III <bruno@wolff.to>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruno Wolff III @ 2007-03-09 15:01 UTC (permalink / raw)
  To: radhika@88thstreet.com; +Cc: pgsql-sql

On Tue, Mar 06, 2007 at 09:32:19 -0500,
  Radhika Sambamurti <sushi@88thstreet.com> wrote:
> 
> From the application's perspective the View is much better as data is
> being stored in one place, reducing errors and also storage.
> But from the db point of view, is there a bigger performace hit when I
> query a view Vs a table or is there no difference.

In postgres, views are essentially macros and there shouldn't be a big
performance hit for using them over issuing the equivalent query.

It sounds like what you might be asking is comparing views to storing
data in denormallized tables (esentially materialized views). You generally
don't want to go there unless you need to, to get acceptible performance.
(And note that denormallizing data doesn't always get you better performance.)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-03-09 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-06 14:32 View Vs. Table Radhika Sambamurti <sushi@88thstreet.com>
2007-03-09 15:01 ` Bruno Wolff III <bruno@wolff.to>

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