Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id BCEB99F97FE for ; Tue, 28 Aug 2007 15:24:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 58910-06 for ; Tue, 28 Aug 2007 15:24:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 312AE9FA252 for ; Tue, 28 Aug 2007 15:24:27 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l7SION27001057; Tue, 28 Aug 2007 14:24:23 -0400 (EDT) To: "Brijesh Shrivastav" cc: pgsql-interfaces@postgresql.org Subject: Re: Issue with PQdescribePortal to describe a select cursor In-reply-to: <5774D66D5EC83645A99B3A905527BB7102933EE6@zipwire.esri.com> References: <5774D66D5EC83645A99B3A905527BB7102933EE6@zipwire.esri.com> Comments: In-reply-to "Brijesh Shrivastav" message dated "Tue, 28 Aug 2007 11:15:02 -0700" Date: Tue, 28 Aug 2007 14:24:23 -0400 Message-ID: <1056.1188325463@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/19 X-Sequence-Number: 6613 "Brijesh Shrivastav" writes: > My problem in executing a portal before I can describe is the way > our client api interface is defined. Typically user sends us a query > that we prepare and describe before sending the describe output > back to the client. In next step user provides us with any input > parameter data for the sql and ask us to execute the query. This > system works well with PQprepare/PQdescribePrepared but doesn't > give me the advantage of a portal. One option that will have a > performance penalty will be to prepare the statement without creating > a portal during initial query so I can send describe results back > to the client and only create the portal during the execute. I will > pay the cost of preparing query twice though I can set LIMIT to 0 > for the initial query to possibly reduce the prepare time. You seem to be confusing preparing a query with executing it. LIMIT 0 isn't going to save any prepare time. regards, tom lane