Re: BUG #5652: Optimizer does wrong thing with partitioned tables - Mailing list pgsql-bugs

From Mladen Gogala
Subject Re: BUG #5652: Optimizer does wrong thing with partitioned tables
Date
Msg-id 4C8A4293.4050005@vmsinfo.com
Whole thread Raw
In response to Re: BUG #5652: Optimizer does wrong thing with partitioned tables  (Euler Taveira de Oliveira <euler@timbira.com>)
Responses Re: BUG #5652: Optimizer does wrong thing with partitioned tables  (Jeff Davis <pgsql@j-davis.com>)
List 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

pgsql-bugs by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: BUG #5652: Optimizer does wrong thing with partitioned tables
Next
From: Chris Travers
Date:
Subject: Re: BUG #5652: Optimizer does wrong thing with partitioned tables