Re: MIN/MAX optimization for partitioned table

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: MIN/MAX optimization for partitioned table
Дата
Msg-id 407d949e0907180313g349d1f2dref273631c138559d@mail.gmail.com
обсуждение исходный текст
Ответ на Re: MIN/MAX optimization for partitioned table  (Alan Li <ali@truviso.com>)
Ответы Re: MIN/MAX optimization for partitioned table  (Alan Li <ali@truviso.com>)
Список pgsql-hackers
This part:

!         /* only try to optimize children rel's */
!         foreach (lc, root->append_rel_list)
!         {
!             AppendRelInfo *a = (AppendRelInfo *) lfirst(lc);
!             
!             if (a->child_relid == childrel->relid &&
!                 a->parent_relid == parentrel->relid)
!             {
!                 appinfo = a;
!                 break;
!             }
!         }

Looks like O(n^2). I guess that's a bigger problem than with just this
patch. Perhaps append_rel_list should be a dynahash in general. I
never really understood why it was simpler to have a single global
append_rel_list anyways.

The other thing is it would be nice if we could avoid making separate
subplans for each child and instead make one for the whole structure
including the aggregate. It would at the very least make the explain
output prettier, but I think it would avoid repeated execution of the
aggregate in some cases as well.

-- 
greg
http://mit.edu/~gsstark/resume.pdf


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: Index AM API changes for deferability
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: WIP patch for TODO Item: Add prompt escape to display the client and server versions