X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A277C9DCC02 for ; Mon, 9 Jan 2006 04:57:56 -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 14293-09 for ; Mon, 9 Jan 2006 04:57:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.pzkagis.cz (gis6.netbox.cz [83.240.30.214]) by postgresql.org (Postfix) with ESMTP id 6348A9DCC01 for ; Mon, 9 Jan 2006 04:57:52 -0400 (AST) Received: from soptik.pzkagis.cz (localhost.localdomain [127.0.0.1]) by smtp.pzkagis.cz (8.13.1/8.13.1) with ESMTP id k098vjkJ029285; Mon, 9 Jan 2006 09:57:45 +0100 Received: (from luf@localhost) by soptik.pzkagis.cz (8.13.1/8.13.1/Submit) id k098vjvV029284; Mon, 9 Jan 2006 09:57:45 +0100 Date: Mon, 9 Jan 2006 09:57:45 +0100 From: Ludek Finstrle To: Zoltan Boszormenyi Cc: Tom Lane , pgsql-odbc@postgresql.org Subject: Re: PsqlODBC slow on UNION queries Message-ID: <20060109085745.GC29135@soptik.pzkagis.cz> References: <43C1F84A.90707@dunaweb.hu> <25908.1136783922@sss.pgh.pa.us> <43C1FEEF.5060107@dunaweb.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43C1FEEF.5060107@dunaweb.hu> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on smtp.pzkagis.cz X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.059 required=5 tests=[AWL=0.059] X-Spam-Score: 0.059 X-Spam-Level: X-Archive-Number: 200601/75 X-Sequence-Number: 6890 > Well, as I said, doing the same test from PSQL, the performance > difference is much less. I was really asking about the difference > between psql and PsqlODBC: > > psql(output to file) psqlodbc > UNION total time: < 12 sec first row received after > 30 seconds > UNION ALL total time < 4 sec first row received instantly I suppose you have used Declare/Fetch turned on. Please try the same query in psql client. The exact query you can find in mylog output. It could be something like DECLARE CURSOR FOR SELECT ; FETCH FORWARD FROM ; If you have used Server side prepare then query is already different. It use: PREPARE [(paremters types)] AS ; EXECUTE [(parameters)]; Regards, Luf