X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 59A3A9DC9CC for ; Fri, 20 Jan 2006 14:56:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32203-05 for ; Fri, 20 Jan 2006 14:56:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pop.xnet.hr (dns1.xnet.hr [82.193.192.5]) by postgresql.org (Postfix) with ESMTP id A0FFE9DCB60 for ; Fri, 20 Jan 2006 14:56:14 -0400 (AST) Received: (qmail 27825 invoked from network); 20 Jan 2006 18:56:41 -0000 Received: by simscan 1.1.0 ppid: 27813, pid: 27815, t: 0.8915s scanners: attach: 1.1.0 clamav: 0.87/m:34/d:1131 spam: 3.1.0 Received: from unknown (HELO ?83.139.74.33?) (83.139.74.33) by pop.xnet.hr with SMTP; 20 Jan 2006 18:56:40 -0000 Message-ID: <43D13217.2030704@zg.htnet.hr> Date: Fri, 20 Jan 2006 19:55:19 +0100 From: Rikard Pavelic User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Stored procedures References: <6.2.1.2.0.20060120120150.08ab7b00@localhost> <20060120172026.GF20182@pervasive.com> <25978.1137783074@sss.pgh.pa.us> In-Reply-To: <25978.1137783074@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200601/353 X-Sequence-Number: 16831 > >> Hi, >> >> Will simple queries such as "SELECT * FROM blah_table WHERE tag='x'; >> work any >> faster by putting them into a stored procedure? > > IMHO no, why do you think so? You can use PREPARE instead, if you have > many > selects like this. I tought that creating stored procedures in database means storing it's execution plan (well, actually storing it like a compiled object). Well, that's what I've learned couple a years ago in colledge ;) What are the advantages of parsing SP functions every time it's called? My position is that preparing stored procedures for execution solves more problems, that it creates. And the most important one to be optimizing access to queries from multiple connections (which is one of the most important reasons for using stored procedures in the first place). Best regards, Rikard