Re: Speeding up loops in pl/pgsql function

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Speeding up loops in pl/pgsql function
Дата
Msg-id BANLkTinGoSk9=5CQVAyvgAK4i+8235REuA@mail.gmail.com
обсуждение исходный текст
Ответ на Speeding up loops in pl/pgsql function  ("Reuven M. Lerner" <reuven@lerner.co.il>)
Список pgsql-performance
Hello

>
> (1) Are there any good guidelines for what operations in pl/pgsql are
> optimized for which data structures?  For example, it turns out that a great
> deal of time is being spent in the substring() function, which surprised me.
>  I thought that by switching to an array, it might be faster, but that
> wasn't the case, at least in my tests.  Having a sense of what I should and
> shouldn't be trying, and which built-in functions are particularly fast or
> slow, would be useful to know.
>

PL/pgSQL is perfect like glue for SQL. For all other isn't good

http://okbob.blogspot.com/2010/04/frequent-mistakes-in-plpgsql-design.html
http://www.pgsql.cz/index.php/PL/pgSQL_%28en%29#When_PL.2FpgSQL_is_not_applicable

>
> (2) Is there any configuration setting that would (perhaps) speed things up
> a bit?  I thought that maybe work_mem would help, but the documentation
> didn't indicate this at all, and sure enough, nothing really changed when I
> increased it.
>
>

probably not

Just PL/pgSQL is not C, and you cannot do some heavy string or array operations.

Regards

Pavel Stehule

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

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: Speeding up loops in pl/pgsql function
Следующее
От: Alex Hunsaker
Дата:
Сообщение: Re: Speeding up loops in pl/pgsql function