Обсуждение: LIBPQ: Can we have buffered PGresult (i.e. a retreival bu chuncks?)

Поиск
Список
Период
Сортировка

LIBPQ: Can we have buffered PGresult (i.e. a retreival bu chuncks?)

От
"Abraham, Danny"
Дата:
Is there a way to break the PGresult array to chunks
Like Oracle?

Thanks

Danny Abraham
BMC Software
CTM&D Business Unit
972-52-4286-513
danny_abraham@bmc.com


Re: LIBPQ: Can we have buffered PGresult (i.e. a retreival bu chuncks?)

От
Reg Me Please
Дата:
Il Thursday 22 November 2007 16:23:25 Abraham, Danny ha scritto:
> Is there a way to break the PGresult array to chunks
> Like Oracle?
>
> Thanks
>
> Danny Abraham
> BMC Software
> CTM&D Business Unit
> 972-52-4286-513
> danny_abraham@bmc.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend


I presume that the usal LIMIT+OFFSET solution is not OK.
Right?

--
Reg me Please
<Non quietis maribus nauta>

Re: LIBPQ: Can we have buffered PGresult (i.e. a retreival bu chuncks?)

От
Gregory Stark
Дата:
"Abraham, Danny" <danny_abraham@bmc.com> writes:

> Is there a way to break the PGresult array to chunks
> Like Oracle?

There isn't a protocol-level way but there is a way in SQL, use cursors and
"FETCH FORWARD <n>"

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's 24x7 Postgres support!

Re: LIBPQ: Can we have buffered PGresult (i.e. a retreival bu chuncks?)

От
Alvaro Herrera
Дата:
Abraham, Danny wrote:
> Is there a way to break the PGresult array to chunks
> Like Oracle?

Sure.  Use a cursor.

--
Alvaro Herrera                               http://www.PlanetPostgreSQL.org/
"Right now the sectors on the hard disk run clockwise, but I heard a rumor that
you can squeeze 0.2% more throughput by running them counterclockwise.
It's worth the effort. Recommended."  (Gerry Pourwelle)