Hello!

> 31 авг. 2018 г., в 2:40, Thomas Munro <thomas.mu...@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.

Reply via email to