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)
Ответы: Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Stephen Frost)
Список: pgsql-performance

Скрыть дерево обсуждения

PostgreSQL Function Language Performance: C vs PL/PGSQL  (Eliot Gable, )
 Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Stephen Frost, )
  Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Eliot Gable, )
   Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Stephen Frost, )
    Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Eliot Gable, )
     Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Stephen Frost, )
      Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Craig James, )
     Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Merlin Moncure, )
      Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Matthew Wakeling, )
       Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Stephen Frost, )
        Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Matthew Wakeling, )
         Re: PostgreSQL Function Language Performance: C vs PL/PGSQL  (Merlin Moncure, )

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 по дате сообщения:

От: Alvaro Herrera
Дата:
Сообщение: Re: Optimize date query for large child tables: GiST or GIN?
От: Alvaro Herrera
Дата:
Сообщение: Re: Optimize date query for large child tables: GiST or GIN?