Re: Pull up aggregate subquery

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pull up aggregate subquery
Date: 2011-05-25 17:49:59
Message-ID: BANLkTi=UifviKg_TRS4dnEa_yj3bNmotsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 25, 2011 at 1:37 PM, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> wrote:
>> How do you decide whether or not to push down?
>
> Yeah, that's the problem. In addition to the conditions of join-qual
> == grouping key && outer is unique on qual, we need some criteria if
> it should be done. At first I started to think I can compare cost of
> two different plan nodes, which are generated by calling
> subquery_planner() twice. But now my plan is to apply some heuristics
> like that join qual selectivity is less than 10% or so. I either don't
> like magic numbers but given Query restructuring instead of
> PlannerInfo (which means we cannot use Path) it is only left way. To
> get it work is my first goal anyway.

I think getting it working is probably a good first goal. I am not
really sure that we want to commit it that way, and I think my vote
would be for you to work on the approach we discussed before rather
than this one, but it's your project, and I think you'll probably
learn enough in getting it working that it will be a step forward in
any case. The planner is complex enough that it's worth trying to get
something that works, first, before trying to make it perfect.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-05-25 17:51:31 Re: adding a new column in IDENTIFY_SYSTEM
Previous Message Alvaro Herrera 2011-05-25 17:49:10 Re: about EDITOR_LINENUMBER_SWITCH