Re: Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?
Дата
Msg-id Zo7aA2m35vGR56MN@nathan
обсуждение исходный текст
Ответ на Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?  (Antonin Houska <ah@cybertec.at>)
Ответы Re: Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?
Список pgsql-hackers
On Wed, Jul 10, 2024 at 05:00:13PM +0200, Antonin Houska wrote:
> I don't quite understand why TransactionIdIsCurrentTransactionId() implements
> binary search in ParallelCurrentXids "from scratch" instead of using
> bsearch().

I believe there are a number of open-coded binary searches in the tree.  My
concern with switching them to bsearch() would be the performance impact of
using a function pointer for the comparisons.  Perhaps we could add a
couple of inlined binary search implementations for common types to replace
many of the open-coded ones.

-- 
nathan



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

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: pg_maintain and USAGE privilege on schema