Re: "append" takes a lot of time in a query

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: "append" takes a lot of time in a query
Дата
Msg-id dcc563d10805211144i592bd400m43238c5def8eae66@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "append" takes a lot of time in a query  (Frank Dekervel <frank.dekervel@smartlounge.be>)
Список pgsql-performance
I think you're looking to return set of record or something like that.

On Wed, May 21, 2008 at 4:37 AM, Frank Dekervel
<frank.dekervel@smartlounge.be> wrote:
> Hello,
>
> Small update on this problem:
>
> Wouter Verhelst came to help debugging, and he determined that the 2 seconds
> were spent planning the query and not executing the query. (executing the
> query is quick as seen in the query plan).
>
> To avoid replanning this query all the time, Wouter suggest replacing the
> query with a stored procedure (so that the query plan was saved). We did a
> proof of concept, and it seemed to work very well.
>
> Another approach would be caching of prepared statements, but i found no
> implementations of this on the net.
>
> We now still need to find a way to hook the stored procs in our O-R mapper:
> generating them the first time a query is done (fairly easy), and
> making "select procname(param1,param2)" behave like a normal query.
>
> We tried a stored procedure returning a cursor and this seemed to work, but
> we'd like to avoid this as, to use cursors, we need to change the core logic
> of our system that decides whether to use transactions and cursors (now the
> system does not create a cursor if it does not expect too many rows coming
> back and so on, and no transaction if no "update" or "insert" queries have to
> be done).

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

Предыдущее
От: Albert Cervera Areny
Дата:
Сообщение: Re: Posible planner improvement?
Следующее
От: "H. Hall"
Дата:
Сообщение: Re: "Big O" notation for postgres?