Re: B-tree cache prefetches

Поиск
Список
Период
Сортировка
От Andrey Borodin
Тема Re: B-tree cache prefetches
Дата
Msg-id 1B4E24CF-9767-43CA-BE89-5CFACA5D7883@yandex-team.ru
обсуждение исходный текст
Ответ на Re: B-tree cache prefetches  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: B-tree cache prefetches
Список pgsql-hackers
Hello!

31 авг. 2018 г., в 2:40, Thomas Munro <thomas.munro@enterprisedb.com> написал(а):
A related topic is the cache-unfriendliness of traditional binary
searches of sorted data.  Check out "Array Layouts for
Comparison-Based Searching"[1] if you haven't already.  It says that
if your array fits in L2 cache, as our btree pages do, then binary
search still wins against Eytzinger et al, which I was a bit
disappointed 
I've re-read that paper. Their results are not about our case, here's a quote:
> For arrays small enough _to be kept_ in L2 cache, the branch-free binary search code listed in Listing 2 is the fastest algorithm

Surely, we cannot keep all pages in L2. Eytzinger layout could be realistic possibility, except one simple problem: I do not see how can we insert items into this layout.

Also, that research is quite distant from B-tree binsearch: thier data items are small and do not represent reference to actual data. Eytzinger exploits the fact that two posiible future keys share same cache line. But it is hard to provide, given we place items at quite random place of the page.

Best regards, Andrey Borodin.

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

Предыдущее
От: Andrey Borodin
Дата:
Сообщение: Re: Experimenting with hash join prefetch
Следующее
От: Dmitry Dolgov
Дата:
Сообщение: Re: Experimenting with hash join prefetch