Re: [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitraryvacuum flags

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitraryvacuum flags
Дата
Msg-id CAB7nPqTiKo1jwY2F_p58fQRoXzRJ6hRY0XadrHbs=Ye6+PpwBw@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitrary vacuum flags  ("Seki, Eiji" <seki.eiji@jp.fujitsu.com>)
Ответы Re: [HACKERS] Proposal: GetOldestXminExtend for ignoring arbitraryvacuum flags  ("Seki, Eiji" <seki.eiji@jp.fujitsu.com>)
Список pgsql-hackers
On Tue, Feb 14, 2017 at 3:19 PM, Seki, Eiji <seki.eiji@jp.fujitsu.com> wrote:
> This change will be useful for features that only reads rows that are visible by all transactions and could not wait
specificprocesses (VACUUM, ANALYZE, etc...) for performance. Our company (Fujitsu) is developing such an extension. In
ourbenchmark, we found that waiting an ANALYZE process created by autovacuum daemon often has a significant impact to
theperformance although the waited process do only reading as to the table. So I hope to ignore it using
GetOldestXminExtendas below. The second argument represents flags to ignore. 
>
>   GetOldestXminExtended(rel, PROC_IN_VACUUM | PROC_IN_LOGICAL_DECODING | PROC_IN_ANALYZE);
>
> Note: We can ignore VACUUM processes or VACUUM with ANALYZE processes using the second option of GetOldesXmin,
"ignoreVacuum".However, we cannot ignore only ANALYZE processes because the "ignoreVacuum" = true is same to the
following.
GetOldestXmin(Relation rel, bool ignoreVacuum){
+   uint8 ignoreFlags = PROC_IN_LOGICAL_DECODING;
+
+   if (ignoreVacuum)
+       ignoreFlags |= PROC_IN_VACUUM;
+
+   return GetOldestXminExtended(rel, ignoreFlags);
+}

It seems to me that it would be far less confusing to just replace the
boolean argument of GetOldestXmin by a uint8 and get those flags
declared in procarray.h, no? There are a couple of code path calling
GetOldestXmin() that do not include proc.h, so it would be better to
not add any extra header dependencies in those files.
--
Michael



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] contrib modules and relkind check
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] REINDEX CONCURRENTLY 2.0