X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D427E52A11 for ; Thu, 7 Jul 2005 10:59:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07513-08 for ; Thu, 7 Jul 2005 13:59:34 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 115B1528CE for ; Thu, 7 Jul 2005 10:59:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j67DxX2l007485; Thu, 7 Jul 2005 09:59:33 -0400 (EDT) To: Niccolo Rigacci Cc: John A Meinel , Postgresql Performance Subject: Re: CURSOR slowes down a WHERE clause 100 times? In-reply-to: <20050707074147.GA16360@rigacci.org> References: <20050706211946.GA3460@rigacci.org> <42CC4D1C.9040606@arbash-meinel.com> <20050707074147.GA16360@rigacci.org> Comments: In-reply-to Niccolo Rigacci message dated "Thu, 07 Jul 2005 09:41:47 +0200" Date: Thu, 07 Jul 2005 09:59:33 -0400 Message-ID: <7484.1120744773@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.109 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200507/69 X-Sequence-Number: 13310 Niccolo Rigacci writes: > How can I EXPLAIN ANALYZE a cursor like this? > BEGIN; > DECLARE mycursor BINARY CURSOR FOR > SELECT ... > FETCH ALL IN mycursor; > END; > I tried to put EXPLAIN ANALYZE in front of the SELECT and in > front of the FETCH, but I got two "syntax error"... Just FYI, you can't EXPLAIN ANALYZE this, but you can EXPLAIN it: EXPLAIN DECLARE x CURSOR FOR ... so you can at least find out what the plan is. It might be cool to support EXPLAIN ANALYZE FETCH --- not sure what that would take. regards, tom lane