Re: Monitoring query plan cache

From: Jan de Visser <jan(at)de-visser(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Monitoring query plan cache
Date: 2014-12-21 16:55:29
Message-ID: 2099551.ZaDQaSW763@capybara
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-12-21 18:08:34 Re: Monitoring query plan cache
Previous Message Adrian Klaver 2014-12-21 15:17:06 Re: pg_dump