Best way to reduce server rounds getting big BLOBs

Поиск
Список
Период
Сортировка
От Jorge Arévalo
Тема Best way to reduce server rounds getting big BLOBs
Дата
Msg-id 55DB3F35B0674051883B4E784D73A941@libregis.org
обсуждение исходный текст
Ответы Re: Best way to reduce server rounds getting big BLOBs  (Eduardo Morrás <emorrasg@yahoo.es>)
Список pgsql-general
Hello,

I'd like to know what's the best way to reduce the number of server rounds in a libpq C app that fetches BLOBs from a
remotePostgreSQL server. 

About 75% of the time my app uses is spent querying database. I basically get binary objects (images). I have to fetch
allthe images from a table. This table can be really big (in number of rows) and each image can be big too. 

I guess I should go for cursors. If I understood the concept of "cursor", basically the query is executed, a ResultSet
isgenerated inside the database server, and the client receives a "pointer" to this ResultSet. You can get all the rows
bymoving this pointer over the ResultSet, calling the right functions. But you still have to go to the database for
eachchunk of data. Am I right? 

I also understand that the "perfect" situation would be to have all the table content in memory in just one server
round,available for my app. But as that's not scalable at all, I want a "good enough" method to avoid (expensive)
travelsto database server. 

Are cursors my best bet?

Many thanks in advance, and sorry if the question is too naive.

--
Jorge Arevalo
Freelance developer

http://www.krop.com/jorgearevalo
http://about.me/jorgeas80

Enviado con Sparrow (http://www.sparrowmailapp.com/?sig)




В списке pgsql-general по дате отправления:

Предыдущее
От: Ingmar Brouns
Дата:
Сообщение: volatile void returning function not executed as often as expected in sql function
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Best way to reduce server rounds getting big BLOBs