Re: [HACKERS] pageinspect: Hash index support

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] pageinspect: Hash index support
Дата
Msg-id CA+TgmoYD6B_GdYb8hhzF10W1YbhxHDuFH9m_TYU3jncmDbrCBA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] pageinspect: Hash index support  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Ответы Re: [HACKERS] pageinspect: Hash index support  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Список pgsql-hackers
On Thu, Feb 9, 2017 at 8:56 AM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>> If you want to verify that the supplied page number is an overflow
>> page before returning the bit, I think you should do that calculation
>> based on the metapage.  There's enough information in hashm_spares to
>> figure out which pages are primary bucket pages as opposed to overflow
>> pages, and there's enough information in hashm_mapp to identify which
>> pages are bitmap pages, and the metapage is always page 0.  If you
>> take that approach, then you can check a million bitmap bits reading
>> only the relevant bitmap pages plus the metapage, which is a LOT less
>> I/O than reading a million index pages.
>
> Thanks for the inputs. Attached is the patch modified as per your suggestions.

I think you should just tighten up the sanity checking in the existing
function _hash_ovflblkno_to_bitno rather than duplicating the code.  I
don't think it's called often enough for one extra (cheap) test to be
an issue.  (You should change the elog in that function to an ereport,
too, since it's going to be a user-facing error message now.)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] ICU integration
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Write Ahead Logging for Hash Indexes