Re: PostgreSQL Function Language Performance: C vs PL/PGSQL

Поиск
Список
Период
Сортировка
От Matthew Wakeling
Тема Re: PostgreSQL Function Language Performance: C vs PL/PGSQL
Дата
Msg-id alpine.DEB.2.00.1006011345220.4083@aragorn.flymine.org
обсуждение исходный текст
Ответ на Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-performance
On Fri, 28 May 2010, Merlin Moncure wrote:
> At best, if you are a ninja with the marginally documented backend
> api, you will create code that goes about as fast as your pl/pgsql
> function for 10 times the amount of input work, unless there are heavy
> amounts of 'other than sql' code in your function.  The reason to
> write C in the backend is:
>
> *) Interface w/3rd party libraries w/C linkage
> *) Do things that are illegal in regular SQL (write files, etc)
> *) Make custom types

The major case I found when writing pl/pgsql was when trying to build
arrays row by row. AFAIK when I tried it, adding a row to an array caused
the whole array to be copied, which put a bit of a damper on performance.

Matthew

--
 "The problem with defending the purity of the English language is that
 English is about as pure as a cribhouse whore. We don't just borrow words;
 on occasion, English has pursued other languages down alleyways to beat
 them unconscious and rifle their pockets for new vocabulary." - James Nicoll

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

Предыдущее
От: Matthew Wakeling
Дата:
Сообщение: Re: Optimize date query for large child tables: GiST or GIN?
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: PostgreSQL Function Language Performance: C vs PL/PGSQL