X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6EB573A4036 for ; Wed, 10 Nov 2004 22:09:58 +0000 (GMT) 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 39912-09 for ; Wed, 10 Nov 2004 22:09:47 +0000 (GMT) Received: from web53503.mail.yahoo.com (web53503.mail.yahoo.com [206.190.37.64]) by svr1.postgresql.org (Postfix) with SMTP id CE6AC3A3D33 for ; Wed, 10 Nov 2004 22:09:47 +0000 (GMT) Received: (qmail 72062 invoked by uid 60001); 10 Nov 2004 22:09:47 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=yeyWC6EhDRssi1j45IZxxXy0Bncditb1Mvq2jWfvxBwMBtdOPfWrhH9eK/vPyr4ICyU2euYi3Rj5viV3vTGVM7Zw1fA9aFJgUipSW5mptKfmeWtZLUftlRTi/NQGfSfMceoKTuWJj2TxtUvAb1OswZUyBI9K71lpquB05auFhdM= ; Message-ID: <20041110220947.72060.qmail@web53503.mail.yahoo.com> Received: from [209.87.238.132] by web53503.mail.yahoo.com via HTTP; Wed, 10 Nov 2004 14:09:47 PST Date: Wed, 10 Nov 2004 14:09:47 -0800 (PST) From: jing han Subject: about libpq-C FETCH ALL performance issue To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.0 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS, FROM_HAS_ULINE_NUMS X-Spam-Level: *** X-Archive-Number: 200411/25 X-Sequence-Number: 5151 Hello, I'm working on a project where libpq-C is envolved. We have several background processes keep querying certain data from database and send them out as ip packets. With libpq-C interface, I have to use res = PQexec(conn, "DECLARE myportal CURSOR FOR select * from pg_database"); and then res = PQexec(conn, "FETCH ALL in myportal"); to get the data. I found when our database has more and more data, res = PQexec(conn, "FETCH ALL in myportal"); cost more and more time, much more than res = PQexec(conn, "DECLARE myportal CURSOR FOR select * from pg_database"); and make our sending packet rate extremely low. We get into big problems here. I wonder if there is other faster way ( I mean other than FETCH ALL command) to get data from database with libpq-C, or If you have a patch to fix this problem. Hope to hear from you soon. Best Regards jing __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com