Re: BUG #5652: Optimizer does wrong thing with partitioned tables
От | Mladen Gogala |
---|---|
Тема | Re: BUG #5652: Optimizer does wrong thing with partitioned tables |
Дата | |
Msg-id | 4C8A4293.4050005@vmsinfo.com обсуждение исходный текст |
Ответ на | Re: BUG #5652: Optimizer does wrong thing with partitioned tables (Euler Taveira de Oliveira <euler@timbira.com>) |
Ответы |
Re: BUG #5652: Optimizer does wrong thing with partitioned
tables
|
Список | 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 по дате отправления: