Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
От | Alexander Korotkov |
---|---|
Тема | Re: [HACKERS] GSoC 2017: weekly progress reports (week 6) |
Дата | |
Msg-id | CAPpHfdvED_-7KbJp-ei4zRZu1brLgkJt4CA-uxF0iRO9WX2Sqw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] GSoC 2017: weekly progress reports (week 6) (Shubham Barai <shubhambaraiss@gmail.com>) |
Ответы |
Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
|
Список | pgsql-hackers |
Hi!
On Wed, Aug 9, 2017 at 6:30 PM, Shubham Barai <shubhambaraiss@gmail.com> wrote:
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
Please find the updated patch for predicate locking in gin index here.There was a small issue in the previous patch. I didn't consider the casewhere only root page exists in the tree, and there is a predicate lock on it,and it gets split.
If we treat the original page as a left page and create a new root and rightpage, then we just need to copy a predicate lock from the left to the rightpage (this is the case in B-tree).But if we treat the original page as a root and create a new left and rightpage, then we need to copy a predicate lock on both new pages (in the case of rum and gin).link to updated code and tests: https://github.com/shubhambaraiss/postgres/ commit/ 6172639a104785f051cb4aa0d511c5 8f2bae65a6
I've assigned to review this patch. First of all I'd like to understand general idea of this patch.
As I get, you're placing predicate locks to both entry tree leaf pages and posting tree leaf pages. But, GIN implements so called "fast scan" technique which allows it to skip some leaf pages of posting tree when these pages are guaranteed to not contain matching item pointers. Wherein the particular order of posting list scan and skip depends of their estimated size (so it's a kind of coincidence).
But thinking about this more generally, I found that proposed locking scheme is redundant. Currently when entry has posting tree, you're locking both:
1) entry tree leaf page containing pointer to posting tree,
2) leaf pages of corresponding posting tree.
Therefore conflicting transactions accessing same entry would anyway conflict while accessing the same entry tree leaf page. So, there is no necessity to lock posting tree leaf pages at all. Alternatively, if entry has posting tree, you can skip locking entry tree leaf page and lock posting tree leaf pages instead.
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
В списке pgsql-hackers по дате отправления: