Re: Patch for fixing a few memory leaks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch for fixing a few memory leaks
Дата
Msg-id 7624.1002410747@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch for fixing a few memory leaks  (Teodor Sigaev <teodor@stack.net>)
Список pgsql-hackers
Teodor Sigaev <teodor@stack.net> writes:
>>> Tom, I want to notice that initGISTstate is called for every inserting
>>> value (for each row). I think it's not good, because this function
>>> called 'fmgr_info' 7 times. 'fmgr_info' call a
>>> 'load_external_function' with execution of sequence search on library
>>> name. Any suggestion?
>> 
>> fmgr_info shouldn't be all that expensive; I'm not really inclined to
>> worry about it.  Do you have evidence to the contrary?

> Result:
> 1. Original gist.c
> % time psql wow < sql.cmd
> psql wow < sql.cmd  0.00s user 0.02s system 0% cpu 7.170 total
> 2. Patched gist.c
> % time psql wow < sql.cmd
> psql wow < sql.cmd  0.02s user 0.00s system 2% cpu 0.699 total

> We can see that calling fmgr_info for 70000 times may be very expensive.

Okay, I've done something about this: fmgr_info results for index
support functions are now kept in the relcache.  I now get roughly
the same timings for loading 10000 tuples into either a plain
btree index or a btree_gist index, rather than a factor-of-7 penalty
for btree_gist as before ...
        regards, tom lane


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

Предыдущее
От: Rene Pijlman
Дата:
Сообщение: Re: anoncvs and CVS link off developers.postgresql.org
Следующее
От: Brent Verner
Дата:
Сообщение: Re: ALTER RENAME and indexes