On Wed, Mar 23, 2016 at 9:43 PM, Amit Kapila <amit.kapila16@gmail.com> wrote: > RecordAndGetPageWithFreeSpace() tries to search from the oldPage passed to > it, rather than from top, so even if RecordPageWithFreeSpace() doesn't > update till root, it will be able to search the newly added page. I agree > with whatever you have said in another mail that we should introduce a new > API to do a more targeted search for such cases.
OK, let's do that, then.
Ok, I have added new API which just find the free block from and start search from last given page.
1. I have named the new function as GetPageWithFreeSpaceUsingOldPage, I don't like this name, but I could not come up with any better, Please suggest one.
And also body of GetPageWithFreeSpaceUsingOldPage looks almost similar to RecordAndGetPageWithFreeSpace, I tried to merge these two but for that we need to pass extra parameter to the function.
2. I also had to write one more function fsm_search_from_addr instead of using fsm_set_and_search. So that we can find block without updating the other slot.
I have done performance test just to ensure the result. And performance is same as old. with both COPY and INSERT.
3. I have also run pgbench read-write what amit suggested upthread.. No regression or improvement with pgbench workload.