Re: Use of additional index columns in rows filtering

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Use of additional index columns in rows filtering
Дата
Msg-id e31162ba4c75a50e41397aa6aaceb0ca79f125f1.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Use of additional index columns in rows filtering  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Ответы Re: Use of additional index columns in rows filtering
Список pgsql-hackers
On Wed, 2023-07-19 at 20:03 +0200, Tomas Vondra wrote:
> Makes sense, I also need to think about maybe not having duplicate
> clauses in the two lists. What annoys me on that it partially
> prevents
> the cost-based reordering done by order_qual_clauses(). So maybe we
> should have three lists ... Also, some of the expressions count be
> fairly expensive.

Can we just calculate the costs of the pushdown and do it when it's a
win? If the random_page_cost savings exceed the costs from evaluating
the clause earlier, then push down.

> BTW could you double-check how I expanded the index_getnext_slot()? I
> recall I wasn't entirely confident the result is correct, and I
> wanted
> to try getting rid of the "while (true)" loop.

I suggest refactoring slightly to have the two loops in different
functions (rather than nested loops in the same function) to make
control flow a bit more clear. I'm not sure if the new function for the
inner loop should be defined in nodeIndexscan.c or indexam.c; I suppose
it depends on how clean the signature looks.

Also please expand the tests a bit to show more EXPLAIN plans that
illustrate the different cases.

Regards,
    Jeff Davis




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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Extracting cross-version-upgrade knowledge from buildfarm client
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Extracting cross-version-upgrade knowledge from buildfarm client