pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Artur Zając <azajac@ang.com.pl>
Cc: pgsql-performance@postgresql.org
Subject: Re: Speed of EXCECUTE in PL/PGSQL
Date: Thu, 14 Mar 2013 15:39:25 -0400
Message-ID: <5142276D.10406@dunslane.net> (raw)
In-Reply-To: <035b01ce20e9$38ec92a0$aac5b7e0$@ang.com.pl>
References: <035b01ce20e9$38ec92a0$aac5b7e0$@ang.com.pl>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>


On 03/14/2013 03:22 PM, Artur Zając wrote:
>
> Why speed of executing (or planning) some very simple query from 
> string in pl/pgsql is dependent from whole query or why “FOR r IN 
> EXECUTE q” is significally slower from “FOR r IN query”?
>
>

The whole point of EXECUTE is that it's reparsed and planned each time. 
You should expect it to be quite a bit slower, and avoid using EXECUTE 
wherever possible.

cheers

andrew



-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (3+ messages)

Message-ID: <5142276D.10406@dunslane.net>
Permalink:  ../5142276D.10406@dunslane.net/
Also on:    postgresql.org/message-id/5142276D.10406@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: andrew@dunslane.net, azajac@ang.com.pl
  Subject: Re: Speed of EXCECUTE in PL/PGSQL
  In-Reply-To: <5142276D.10406@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox