vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| When you do a PQexec call in libpq, does PostgreSQL produce the entire result in memory on the server side, and then does libpq hold the entire result in memory after it retrieves it? The only time that the server sends parts of the result at a time is with a cursor, right? And libpq always holds the data that it gets back, right? I guess what I'm asking is, where is the PGresult data actually stored, and how much of it is stored in the client application at a time? Regards, Jeff Davis ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend |
| |||
| From what I understand: On Mon, Jan 24, 2005 at 12:14:09PM -0800, Jeff Davis wrote: > When you do a PQexec call in libpq, does PostgreSQL produce the entire > result in memory on the server side, and then does libpq hold the entire > result in memory after it retrieves it? The server sends the data straight and then forgets it, but the client library stores all the results before returning. > The only time that the server sends parts of the result at a time is > with a cursor, right? And libpq always holds the data that it gets back, > right? In a sense. The result of a FETCH is the whole resultset for that statement, but it keeps the query around for other FETCHes. I don't believe it holds the entire result (although maybe with a sort...???) Hope this helps, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFB9XHaY5Twig3Ge+YRAkryAKDUfdxZruehJA+pmGtsf3 a3DDJK9ACdF38W taurc6RwMXHa4RUz+Gw/jUU= =bxh/ -----END PGP SIGNATURE----- |
| ||||
| Jeff Davis <jdavis-pgsql@empires.org> writes: > When you do a PQexec call in libpq, does PostgreSQL produce the entire > result in memory on the server side, and then does libpq hold the entire > result in memory after it retrieves it? No, and yes. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) |