Re: Parallel append plan instability/randomness

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Parallel append plan instability/randomness
Дата
Msg-id CA+TgmoaAWXyFUY1BgkYcH3DE4Xrot1qPgAOLW2Gj8OgQOVNg0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parallel append plan instability/randomness  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: Parallel append plan instability/randomness
Список pgsql-hackers
On Sun, Jan 7, 2018 at 11:40 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> One theory that can explain above failure is that the costs of
> scanning some of the sub-paths is very close due to which sometimes
> the results can vary.  If that is the case, then probably using
> fuzz_factor in costs comparison (as is done in attached patch) can
> improve the situation, may be we have to consider some other factors
> like number of rows in each subpath.

This isn't an acceptable solution because sorting requires that the
comparison operator satisfy the transitive property; that is, if a = b
and b = c then a = c.  With your proposed comparator, you could have a
= b and b = c but a < c.  That will break stuff.

It seems like the obvious fix here is to use a query where the
contents of the partitions are such that the sorting always produces
the same result.  We could do that either by changing the query or by
changing the data in the partitions or, maybe, by inserting ANALYZE
someplace.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Invalid pg_upgrade error message during live check
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] [PROPOSAL] Temporal query processing with range types