Re: Strange assertion using VACOPT_FREEZE in vacuum.c

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Strange assertion using VACOPT_FREEZE in vacuum.c
Дата
Msg-id CAB7nPqRdxghgFA_r1oMaeg2NOUddearNpK6kHnU1RRbXdWr8WQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Strange assertion using VACOPT_FREEZE in vacuum.c  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Strange assertion using VACOPT_FREEZE in vacuum.c  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Fri, Mar 6, 2015 at 12:42 AM, Robert Haas wrote:
> On Thu, Mar 5, 2015 at 9:58 AM, Alvaro Herrera wrote:
>> Here's a simple idea to improve the patch: make VacuumParams include
>> VacuumStmt and the for_wraparound and do_toast flags.  ISTM that reduces
>> the number of arguments to be passed down in a couple of places.  In
>> particular:
>>
>> vacuum(VacuumParams *params, BufferAccessStrategy bstrategy, bool isTopLevel)
>>
>> vacuum_rel(VacuumParams *params)
>>
>> Does that sound more attractive?
>
> I dislike passing down parser nodes straight into utility commands.
> It tends to make those those functions hard for in-core users to call,
> and also to lead to security vulnerabilities where we look up the same
> names more than once and just hope that we get the same OID every
> time.  Stuffing the VacuumStmt pointer inside the VacuumParams object
> doesn't, for me, help anything.  It'd be a lot more interesting if we
> could get rid of that altogether.

Do you mean removing totally VacuumStmt from the stack? We would then
need to add relation and va_cols as additional arguments of things
like vacuum_rel, analyze_rel, do_analyze_rel or similar.

FWIW, adding do_toast and for_wraparound into VacuumParams makes sense
to me, but not VacuumStmt. It has little meaning as VacuumParams
should be used for parameters.
-- 
Michael



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: [REVIEW] Re: Compression of full-page-writes
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Table-level log_autovacuum_min_duration