Re: Views of views, complexity and speed.

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: bombadil(at)wanadoo(dot)es
Cc: Lista PostgreSql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Views of views, complexity and speed.
Date: 2002-02-06 15:48:03
Message-ID: 200202061548.g16Fm4D04458@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

bombadil(at)wanadoo(dot)es wrote:
> El martes 05 de febrero, Jan Wieck escribió:
> > The question I have is what do you really compare? You said
> > "looking in plain tables instead of other views". Does that
> > mean your query is faster when you build one big view against
> > all the base tables instead of cascaded views, or what? What
> > is the performance difference if you instead of using the
> > cascaded views query all the base tables in a big join
> > directly?
>
> Your comment resumes very well my essential question. I only want to
> know if there is a reason for thinkink that a cascade of views can be
> slower than a complex view that includes all tables. Is the planner
> well tuned for working with this complex cases (cascade of views)?
>
> Actually I am making experiments with all this stuff. Better idea
> than sending a lazy question in the list.

In principle the penalty for cascading views should be
negligible, because the resulting queryplan after rewriting
ought to be comparable to what you would have to write as
query yourself, if you wouldn't have views at all. So after
some recursion in the rewriter, the planner and optimizer
should face the same join problem.

As long as your not gonna write triggers to maintain the
information you want from the views in plain tables, the
answer is that there is no significant performance
difference.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message bombadil 2002-02-06 15:52:22 Problem with a view (not lazy ;)
Previous Message Tom Lane 2002-02-06 15:38:37 Re: pg_dump out of range error (7.1.3)