Re: algebraic rewriting

From: sophie yang <yangsophie(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: algebraic rewriting
Date: 2002-04-20 01:59:50
Message-ID: 20020420015950.85083.qmail@web10501.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

What I mean about "algebraic rewriting" is some
rule-based simplification optimization. For example,
Say we have two relations: R(A, B), S(B, C).
Simplification rules include:
1) R join R = R
2) R - R = NULL
3) NULL join R = NULL
4) SELECT[A=a](R join S) = (SELECT[A=a](R)) join S
e.g.
(select * from R, S where R.B=S.B and R.A=a) =>
(select * from R, S where R.A=a and R.B=S.B)
5) PROJECT[A,B](R JOIN S) = R JOIN (PROJECT[B](S))
6) PROJECT[A](PROJECT[A,B](R)) = PROJECT[A](R)
etc.

I am wondering if progreSQL does such simplification
to prune the plan space before estimate costs?

Sophie Yang

--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> sophie yang <yangsophie(at)yahoo(dot)com> writes:
> > rewriter, optimizer and executor. I am wondering
> at
> > which step, PostgreSQL performs algebraic
> rewriting?
>
> What do you consider "algebraic rewriting"? The
> optimizer does a pass of
> constant-subexpression simplification, and also some
> boolean-expression
> normalization, but I'm not sure if that's what
> you're looking for.
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message pinkrain . 2002-04-20 03:00:11 Right-justification of column results
Previous Message Tom Lane 2002-04-19 23:31:40 Re: updateble views