Re: _mdfd_getseg can be expensive
| От | Tom Lane |
|---|---|
| Тема | Re: _mdfd_getseg can be expensive |
| Дата | |
| Msg-id | 12336.1414795725@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: _mdfd_getseg can be expensive (Andres Freund <andres@2ndquadrant.com>) |
| Ответы |
Re: _mdfd_getseg can be expensive
|
| Список | pgsql-hackers |
Andres Freund <andres@2ndquadrant.com> writes:
> I wrote the attached patch that get rids of that essentially quadratic
> behaviour, by replacing the mdfd chain/singly linked list with an
> array. Since we seldomly grow files by a whole segment I can't see the
> slightly bigger memory reallocations matter significantly. In pretty
> much every other case the array is bound to be a winner.
> Does anybody have fundamental arguments against that idea?
While the basic idea is sound, this particular implementation seems
pretty bizarre. What's with the "md_seg_no" stuff, and why is that
array typed size_t? IOW, why didn't you *just* replace the linked
list with an array? This patch seems to be making some other changes
that you've failed to explain.
regards, tom lane
В списке pgsql-hackers по дате отправления: