Re: How to write a function that manipulates a set of results

Поиск
Список
Период
Сортировка
От Ashley Moran
Тема Re: How to write a function that manipulates a set of results
Дата
Msg-id 03E25DA6-BC44-44BA-8E3C-9C0EFE5152A7@ashleymoran.me.uk
обсуждение исходный текст
Ответ на Re: How to write a function that manipulates a set of results  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How to write a function that manipulates a set of results  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: How to write a function that manipulates a set of results  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
On Mar 14, 2007, at 7:25 pm, Tom Lane wrote:
> Sure: use a table.  What was the objection to temp tables exactly?


My boss is under the impression that calling the procedure twice on
the same connection creates a name conflict for the temporary table.

Also I'm unsure how the use of temporary tables will affect the
running of the query.  This function will be called up to 400 times
by a wrapping function that needs to complete quickly (relatively -
the calculations need to return in a few seconds).  I haven't had
chance to read much about PG temp tables yet, so I don't know how the
implementation works.  Are small tables stored in RAM, or does
creating a temporary table always force a disk write?

Sorry my sheer ignorance here.  I have already written a working,
fully tested - albeit unoptimised - implementation of this algorithm
in Ruby, accessible as a basic (HTTP GET) web service.  However, a
developer here believes that the overhead of an HTTP connection over
our gigabit LAN will add too much to the (> 1 second) running time of
the calculations.  This means that for political reasons we are
forced to rewrite it as a stored procedure that we can call directly
from application code.  The project is urgent, the aforementioned
developer is now on holiday, and so my non-developer boss is
scrabbling to learn PL/pgsql and I am forced to bombard the list with
inane questions.  Thanks for your patience :)

Ashley




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

Предыдущее
От: Klint Gore
Дата:
Сообщение: Re: Debugging Server Code
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: How to write a function that manipulates a set of results