Re: BUG #5652: Optimizer does wrong thing with partitioned tables

From: Mladen Gogala <mgogala(at)vmsinfo(dot)com>
To: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5652: Optimizer does wrong thing with partitioned tables
Date: 2010-09-10 14:37:07
Message-ID: 4C8A4293.4050005@vmsinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Euler Taveira de Oliveira wrote:
> Mladen Gogala escreveu:
>
>> Optimizer chooses to scan each partitioned table sequentially, instead of
>> using the available index:
>>
>>
> This is not a bug. How would the optimizer know that the maximum value is in
> that specific partition? There is neither a global index for a partitioned
> table nor an optimizer artifact to know aggregate information before scanning
> all of the partitions. Maybe when we have a better support for table
> partitioning such optimizer artifact would be implemented but don't hold your
> breath.
>
>
>
Euler, optimizer is selecting a wrong path, which is a bug by
definition. I am not asking the optimizer to know what is the maximum, I
am asking it to select the right path, something that it isn't doing. As
is visible from the original bug report, the optimizer is choosing
sequential scan instead of the index scan. When only a single partition
is involved, the index scan is selected, while for the entire table,
sequential scan is selected for every partition.

--

Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
http://www.vmsinfo.com
The Leader in Integrated Media Intelligence Solutions

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chris Travers 2010-09-10 15:10:15 Re: BUG #5652: Optimizer does wrong thing with partitioned tables
Previous Message Euler Taveira de Oliveira 2010-09-10 13:31:38 Re: BUG #5652: Optimizer does wrong thing with partitioned tables