Re: On query rewrite - Mailing list pgsql-hackers

From Sailesh Krishnamurthy
Subject Re: On query rewrite
Date
Msg-id mjqlljdj7z3.fsf@cs.berkeley.edu
Whole thread Raw
In response to Re: On query rewrite  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: On query rewrite
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
   >> Are these alternatives (pulling up vs not pulling up   >> subqueries) considered in different plans ?
   Tom> That particular choice is not --- we do it if we can, else   Tom> not.  Comparisons between different
alternativesare always   Tom> handled by computing cost estimates and choosing the lowest.
 

Thank you Tom (and Alvarro)

So I've understood pull_up_subqueries (called SELECT MERGE in
Starburst). 

What about things like:

1. DISTINCT PULLUP (Where you realize that you don't have to have an
explicit duplicate elimination operation because of what's done in the
subquery)

2. DISTINCT pushdown (when a dup elim. can be pushed down if the upper
querytree is performign DISTINCT set operations (UNION, INTERSECT etc)

3. Discarding DISTINCT in a subquery because the upper query uses the
subquery with existential quantification

In general, I'm trying to understand all the transformations that
pgsql will try to do .. I'm not trying to figure out plan enumeration
for basic boxes (simple query tree).

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh




pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Nested xacts: looking for testers and review
Next
From: Gaetano Mendola
Date:
Subject: Re: tablespaces and DB administration