Re: [HACKERS] I want to change libpq and libpgtcl for better handling of large query results

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: teo(at)flex(dot)ro (Constantin Teodorescu)
Cc: pgsql-hackers(at)postgreSQL(dot)org, mviorel(at)flex(dot)ro
Subject: Re: [HACKERS] I want to change libpq and libpgtcl for better handling of large query results
Date: 1998-01-06 02:15:10
Message-ID: 199801060215.VAA07681@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Getting a query result from Tcl/Tk (pg_select function) uses PQexec.
> But PQexec IS GETTING ALL THE RECORDS IN MEMORY and after that user can
> handle query results.
> But what if table has thousand records ? Probably I would need more than
> 512 Mb of RAM in order to get a report finished.

This issue has come up before. The accepted solution is to open a
cursor, and fetch whatever records you need. The backend still
generates the full result, but the front end requests the records it
wants.

Does that not work in your case?

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Cary B. O'Brien 1998-01-06 03:43:19 Block Sizes
Previous Message Thomas G. Lockhart 1998-01-06 01:55:02 Re: [PORTS] Postgress installation in HP-UX 10.20.