Обсуждение: Preparing statement using PQexec vs PQprepare

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

Preparing statement using PQexec vs PQprepare

От
tonymark09
Дата:
Hello,

Is preparing a statement using PQexec and executing it is much slower that
using other API such as PQprepare and PQexecPrepared?

Best regards,
Mark



--
View this message in context: http://postgresql.nabble.com/Preparing-statement-using-PQexec-vs-PQprepare-tp5862628.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Preparing statement using PQexec vs PQprepare

От
Merlin Moncure
Дата:
On Wed, Aug 19, 2015 at 5:55 AM, tonymark09 <tonymark09@gmail.com> wrote:
> Hello,
>
> Is preparing a statement using PQexec and executing it is much slower that
> using other API such as PQprepare and PQexecPrepared?

PQexec can be faster than a combination of PQprepare and
PQexecPrepared particularly if you only need to execute the query
once, but I don't recommend using it for the most part.   If the query
is to be executed many times, or has a lot of parameters, you'll want
to use the prepared interface.

merlin