pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jwieck@debis.com
Cc: secret@kearneydev.com
Cc: pgsql-sql@postgreSQL.org
Cc: johnridout@ctasystems.co.uk
Subject: Re: [SQL] Good Optimization
Date: Wed, 07 Jul 1999 14:10:48 -0400
Message-ID: <26591.931371048@sss.pgh.pa.us> (raw)
In-Reply-To: <m111vPN-0003ktC@orion.SAPserv.Hamburg.dsh.de>

wieck@debis.com (Jan Wieck) writes:
>     I think the best place for it will  be  at  the  top  of  the
>     optimizer.    It's   more   an  optimization  issue  even  if
>     implemented in rewriting technique.

I have thought for some time that we need an additional phase in between
the rewriter and the planner/optimizer proper.  This phase would be the
right place to do constant-subexpression folding, cnfify(), and any
other rearrangements of the parse tree that would be likely to help the
planning process.  So far, the only specific example I had in mind was
the index restriction clauses that are added for LIKE and ~ matches with
a constant initial pattern --- those are currently done by gram.y but
I think they need to happen much later.  If this idea of propagating
restriction clauses across a join is really worthwhile, then this new
optimization phase would be the right place for that too.

The reason I'd prefer to keep it separate from the rewriter is that the
rewriter is mostly concerned with functionality (implementing views etc)
whereas this new module would be concerned with optimization.  Obviously
you do not want to start worrying about optimization until you've got
the fully expanded query available.

			regards, tom lane



view thread (27+ messages)  latest in thread

Message-ID: <26591.931371048@sss.pgh.pa.us>
Permalink:  ../26591.931371048@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26591.931371048@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jwieck@debis.com, secret@kearneydev.com, johnridout@ctasystems.co.uk
  Subject: Re: [SQL] Good Optimization
  In-Reply-To: <26591.931371048@sss.pgh.pa.us>
  References: <m111vPN-0003ktC@orion.SAPserv.Hamburg.dsh.de> <26591.931371048@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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