Re: query decorrelation in postgres

From: mahendra chavan <mahcha(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: query decorrelation in postgres
Date: 2009-07-24 06:27:51
Message-ID: 5a0dbeb90907232327g22b9f3b1hefc8e281a6225eb0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am sorry for not elaborating on that. What I meant by de-correlation was
optimizing a query to get rid of sub-queirs by using joins.

eg. In the TPC-H schema, a query to find out the names of suppliers who
supply parts having size < 100

*Query with nested subqueries:*

SELECT
S_NAME
FROM
SUPPLIER
WHERE
S_SUPPKEY
IN (
SELECT
PS_SUPPKEY
FROM
PARTSUPP
WHERE
PS_PARTKEY
IN (
SELECT
P_PARTKEY
FROM
PART
WHERE
P_SIZE < 100
)

*Query with joins without subqueries:*

SELECT
S_NAME
FROM
SUPPLIER
INNER JOIN
PARTSUPP
ON
S_SUPPKEY = PS_SUPPKEY
INNER JOIN
PART
ON
P_PARTKEY = PS_PARTKEY
WHERE
P_SIZE < 100

Thanks,
Mahendra

On Thu, Jul 23, 2009 at 9:02 PM, Itagaki Takahiro <
itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:

>
> mahendra chavan <mahcha(at)gmail(dot)com> wrote:
>
> > I am a master's student in computer science at IIT Bombay. As part of my
> > project, I need to get a decorrelated version of a SQL query. Please
> could
> > anyone let me know if we have query decorrelation feature implemented in
> > postgres ?
>
> What do you mean by "query decorrelation"? Is it an addtional method for
> query optimization? At least there is no word 'decorrelation' in
> the postgres documentation.
>
> Regards,
> ---
> ITAGAKI Takahiro
> NTT Open Source Software Center
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2009-07-24 07:09:29 Re: Aggregate-function space leakage
Previous Message KaiGai Kohei 2009-07-24 06:00:32 Re: SE-PostgreSQL?