Re: [HACKERS] pageinspect and hash indexes
От | Amit Kapila |
---|---|
Тема | Re: [HACKERS] pageinspect and hash indexes |
Дата | |
Msg-id | CAA4eK1+8CFw+y7cM6qbM1Br43KFnL4yRaEUQHCR2FdBAgC_uWw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] pageinspect and hash indexes (Ashutosh Sharma <ashu.coek88@gmail.com>) |
Список | pgsql-hackers |
On Tue, Mar 21, 2017 at 10:15 AM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote: >> >> I think it is not just happening for freed overflow but also for newly >> allocated bucket page. It would be good if we could mark freed >> overflow page as UNUSED page rather than just initialising it's header >> portion and leaving the page type in special area as it is. Attached >> is the patch '0001-mark_freed_ovflpage_as_UNUSED_pagetype.patch' that >> marks a freed overflow page as an unused page. >> >> Also, I have now changed pageinspect module to handle unused and empty >> hash index page. Attached is the patch >> (0002-allow_pageinspect_handle_UNUSED_OR_EMPTY_hash_pages.patch) for >> the same. >> >> [1] - https://www.postgresql.org/message-id/CAE9k0P%3DN%2BJjzqnHqrURE7ZQMgySRpv%3DBkjafbz%3DpeD4cbCgbhA%40mail.gmail.com >> I have yet to review your patches, let's first try to clear other things before doing so. > > I think when expanding hash index table we are only initialising the > pages that will be in-use after split or the last block in the index. > The initial few pages where tuples will be moved from old to new pages > has no issues but the last block that is just initialised and is not > marked as hash page needs to be handled along with the freed overflow > page. > I think PageIsEmpty() check in hashfuncs.c is sufficient for same. I don't see any value in treating the last page allocated during _hash_alloc_buckets() any different from other pages which are prior to that but will get allocated when required. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: