Skip site navigation (1) Skip section navigation (2)

about libpq-C FETCH ALL performance issue

From: jing han <jing_han_66(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: about libpq-C FETCH ALL performance issue
Date: 2004-11-10 22:09:47
Message-ID: 20041110220947.72060.qmail@web53503.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
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 
 


pgsql-interfaces by date

Next:From: jing hanDate: 2004-11-11 17:00:50
Subject: about libpq-C FETCH performance issue
Previous:From: Gaetano SferraDate: 2004-11-10 14:22:43
Subject: Re: ecpg: using a cursor returned by a stored function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group