Re: BUG #16807: Assert failed in postgres_fdw/estimate_path_cost_size with an empty foreign table

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема Re: BUG #16807: Assert failed in postgres_fdw/estimate_path_cost_size with an empty foreign table
Дата
Msg-id CAPmGK16Te7mLsxJ6yaPmJy_qFdmXEmqegxXm4sNQRprYsxtmfg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #16807: Assert failed in postgres_fdw/estimate_path_cost_size with an empty foreign table  (Etsuro Fujita <etsuro.fujita@gmail.com>)
Ответы Re: BUG #16807: Assert failed in postgres_fdw/estimate_path_cost_size with an empty foreign table  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-bugs
On Wed, Jan 6, 2021 at 12:15 PM Etsuro Fujita <etsuro.fujita@gmail.com> wrote:
> Reproduced.  Will look into this closely.

If foreignrel->tuples is set to zero, the retrieved_rows estimate will
also be set to zero, so the assertion pointed out upthread is not
correct.  I think I mistakenly assumed that foreignrel->tuples would
have been forced to be at least one row, like foreignrel->rows, before
we get to estimate_path_cost_size(), which is not correct.

To fix, I think it would be better to adjust the assertion accordingly
than removing it, since it was added to make sure that the
retrieved_rows estimate is set to a sensible value.  Attached is a
patch for that.  I added a simpler test case as well.

Best regards,
Etsuro Fujita

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16824: Planner chooses poor path on query with Merge Join and pagination
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: BUG #16807: Assert failed in postgres_fdw/estimate_path_cost_size with an empty foreign table