Re: [SQL] ERROR: DefineQueryRewrite: rule plan string too big. - Mailing list pgsql-sql

From wieck@debis.com (Jan Wieck)
Subject Re: [SQL] ERROR: DefineQueryRewrite: rule plan string too big.
Date
Msg-id m118h3s-0003kvC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [SQL] ERROR: DefineQueryRewrite: rule plan string too big.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:

> I originally thought that this wouldn't work because the final parsetree
> for the top query would incorporate the other two parsetrees and still
> be too big.  But it looks like it doesn't --- when I experimented just
> now, the stored parsetree for a view referencing another view treated
> the sub-view as just a table with no inner structure.  I suppose the
> expansion doesn't happen until plan/optimize time.

    It  happens  during  rewrite  time.  The querytree stored for
    rules is just the UNrewritten output of  the  parser.  That's
    why  the rewriter is recursively calling itself with it's own
    output.

    So splitting up such a huge view into a  tree  of  views  (if
    possible)  is  a solution that must not result in a different
    final querytree (after applying  all  view  rules).  It  just
    takes  a little more time for the rewrite step - but I cannot
    estimate how much more.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #

pgsql-sql by date:

Previous
From: Christian Rudow
Date:
Subject: NOT IN clause performing badly
Next
From: Herouth Maoz
Date:
Subject: Re: [SQL] Expr Abbreviations/Functions?