Using the EXPLAIN results

Поиск
Список
Период
Сортировка
Искать

Using the EXPLAIN results

От:
Braud Agnes <Agnes.Braud@lifo.univ-orleans.fr>
Дата:
Hi

I am using the libpq library, and I would like to get the plan
returned by the explain command for a given query to decide
if I execute the query or not. I want to get the time predicted
by the optimizer for the execution of the query.
Is it possible to get the plan as a string in a C or C++ program ?
Thanks.

Agnes.



Re: Using the EXPLAIN results

От:
Neil Conway <nconway@klamath.dyndns.org>
Дата:
On Fri, 24 May 2002 20:26:39 +0200
"Braud Agnes"  wrote:

> Hi
> 
> I am using the libpq library, and I would like to get the plan
> returned by the explain command for a given query to decide
> if I execute the query or not. I want to get the time predicted
> by the optimizer for the execution of the query.
> Is it possible to get the plan as a string in a C or C++ program ?

In 7.3, EXPLAIN results are returned as a result set -- so then it
should be easy to use within a program.

Prior to that, you can use PQsetNoticeProcessor().

Cheers,

Neil

-- 
Neil Conway 
PGP Key ID: DB3C29FC
FAQ