Re: [patch] _bt_binsrch* improvements - equal-prefix-skip binary search
От | Peter Geoghegan |
---|---|
Тема | Re: [patch] _bt_binsrch* improvements - equal-prefix-skip binary search |
Дата | |
Msg-id | CAH2-WznPxocJKaz=XMqKqPauawi-vtB62oXT9SkHhDNb7cpV9Q@mail.gmail.com обсуждение исходный текст |
Ответ на | [patch] _bt_binsrch* improvements - equal-prefix-skip binary search (Matthias van de Meent <boekewurm+postgres@gmail.com>) |
Ответы |
Re: [patch] _bt_binsrch* improvements - equal-prefix-skip binary search
|
Список | pgsql-hackers |
On Fri, Sep 11, 2020 at 7:57 AM Matthias van de Meent <boekewurm+postgres@gmail.com> wrote: > I've not yet been involved in postgresql's development process, so here's a first. Please find attached a patch for improvingthe BT binary search speeds, with accompanying performance data. > > v1-0001 adapts _bt_compare and _bt_binsrch* to make use of static properties of L&Y-style nbtree indexes to speed up findingan initial position in the nbtee. Are you familiar with this thread? https://www.postgresql.org/message-id/CAH2-Wzn_NAyK4pR0HRWO0StwHmxjP5qyu+X8vppt030XpqrO6w@mail.gmail.com I wrote a patch that implemented the same idea, which is sometimes called dynamic prefix truncation. I found some very subtle problems with it, though. Concurrent page deletions could occur, which could cause a scan that skips a prefix to miss that the page it landed on doesn't have the same common prefix anymore. > there could be a large throughput increase for short strings if the collation lookup from lc_collate_is_c() in varstr_cmpcould be reused in the subsequent call to pg_newlocale_from_collation() I noticed that myself recently. -- Peter Geoghegan
В списке pgsql-hackers по дате отправления: