Re: [HACKERS] ExecInitAppend
От | Chris Bitmead |
---|---|
Тема | Re: [HACKERS] ExecInitAppend |
Дата | |
Msg-id | 389F9FBC.FB352F00@nimrod.itg.telecom.com.au обсуждение исходный текст |
Ответ на | ExecInitAppend (Chris Bitmead <chrisb@nimrod.itg.telstra.com.au>) |
Список | pgsql-hackers |
Tom Lane wrote: > > Chris Bitmead <chrisb@nimrod.itg.telstra.com.au> writes: > > In ExecInitAppend it initialises all the subplans... > > And then at the end of the function, it initialises the first plan > > again... > > Is this code correct? Should the first plan really be initialised twice? > > Probably not --- I imagine that's wasting memory, or worse. Do things > still work if you remove the extra initialize call? This code looks ugly because it sets appendstate->as_whichplan so that exec_append_initialise_next knows which plan it's supposed to initialise - yucky side effect. I suspect it will stop working if the last call is removed because it *may* be relying on the first plan to be initialised last, so that the estate variables are initialised to the first plan. It may work if the plans are initialised in reverse order, but the right way is probably to reorganise the code.
В списке pgsql-hackers по дате отправления: