Re: Monitoring query plan cache - Mailing list pgsql-general

From Jan de Visser
Subject Re: Monitoring query plan cache
Date
Msg-id 2099551.ZaDQaSW763@capybara
Whole thread Raw
In response to Re: Monitoring query plan cache  (Andomar <andomar@aule.net>)
List pgsql-general
On December 21, 2014 04:08:43 PM Andomar wrote:
> It is not always easy to tell the query type (function, prepared or
> ad-hoc.) We use Python in mod_wsgi with psycopg2. The code shows ad-hoc
> SQL, but who knows what the many layers between Python and the database do.

psycopg2 sends the SQL you feed it straight to the DB. If you don't feed it a
PREPARE statement [1] it'll be an ad-hoc query; the value placeholders will be
interpolated prior to statement submission by psycopg2.


[1] http://www.postgresql.org/docs/9.2/interactive/sql-prepare.html




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_dump
Next
From: Tom Lane
Date:
Subject: Re: Monitoring query plan cache