Re: CURSOR slowes down a WHERE clause 100 times?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CURSOR slowes down a WHERE clause 100 times?
Дата
Msg-id 7484.1120744773@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: CURSOR slowes down a WHERE clause 100 times?  (Niccolo Rigacci <niccolo@rigacci.org>)
Список pgsql-performance
Niccolo Rigacci <niccolo@rigacci.org> writes:
> How can I EXPLAIN ANALYZE a cursor like this?

>   BEGIN;
>   DECLARE mycursor BINARY CURSOR FOR
>     SELECT ...
>   FETCH ALL IN mycursor;
>   END;

> I tried to put EXPLAIN ANALYZE in front of the SELECT and in
> front of the FETCH, but I got two "syntax error"...

Just FYI, you can't EXPLAIN ANALYZE this, but you can EXPLAIN it:

    EXPLAIN DECLARE x CURSOR FOR ...

so you can at least find out what the plan is.

It might be cool to support EXPLAIN ANALYZE FETCH --- not sure what that
would take.

            regards, tom lane

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

Предыдущее
От: Dawid Kuroczko
Дата:
Сообщение: Re: Surprizing performances for Postgres on Centrino
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to speed up delete