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 9EB9F9DC807 for ; Mon, 16 Jan 2006 13:55:41 -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 00612-05 for ; Mon, 16 Jan 2006 13:55:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from alvh.no-ip.org (201-220-123-7.bk10-dsl.surnet.cl [201.220.123.7]) by postgresql.org (Postfix) with ESMTP id 3A0889DC82A for ; Mon, 16 Jan 2006 13:55:34 -0400 (AST) Received: by alvh.no-ip.org (Postfix, from userid 1000) id DC34DC2DC59; Mon, 16 Jan 2006 14:57:38 -0300 (CLST) Date: Mon, 16 Jan 2006 14:57:38 -0300 From: Alvaro Herrera To: Tom Lane Cc: Alessandro Baretta , pgsql-performance@postgresql.org Subject: Re: Suspending SELECTs Message-ID: <20060116175738.GB32100@surnet.cl> Mail-Followup-To: Tom Lane , Alessandro Baretta , pgsql-performance@postgresql.org References: <43CB71AC.20203@barettadeit.com> <9766.1137433907@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9766.1137433907@sss.pgh.pa.us> User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.984 required=5 tests=[AWL=0.065, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.984 X-Spam-Level: * X-Archive-Number: 200601/204 X-Sequence-Number: 16682 Tom Lane wrote: > Alessandro Baretta writes: > > I am aware that what I am dreaming of is already available through > > cursors, but in a web application, cursors are bad boys, and should be > > avoided. What I would like to be able to do is to plan a query and run > > the plan to retreive a limited number of rows as well as the > > executor's state. This way, the burden of maintaining the cursor "on > > hold", between activations of the web resource which uses it, is > > transferred from the DBMS to the web application server, > > This is a pipe dream, I'm afraid, as the state of a cursor does not > consist exclusively of bits that can be sent somewhere else and then > retrieved. I wonder if we could have a way to "suspend" a transaction and restart it later in another backend. I think we could do something like this using the 2PC machinery. Not that I'm up for coding it; just an idea that crossed my mind. -- Alvaro Herrera Developer, http://www.PostgreSQL.org Oh, oh, las chicas galacianas, lo harán por las perlas, ˇY las de Arrakis por el agua! Pero si buscas damas Que se consuman como llamas, ˇPrueba una hija de Caladan! (Gurney Halleck)