Re: Preparing statement using PQexec vs PQprepare

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: tonymark09 <tonymark09(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Preparing statement using PQexec vs PQprepare
Date: 2015-08-20 13:42:57
Message-ID: CAHyXU0yF3XyS4ef2ZkNE++58HwO65pwKW0DJFVF-czF3fwienA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 19, 2015 at 5:55 AM, tonymark09 <tonymark09(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurent Laborde 2015-08-20 13:50:26 hot backup with zfs ?
Previous Message Joshua D. Drake 2015-08-20 03:50:48 Re: PostgreSQL customer list