Re: SELECT very slow

Поиск
Список
Период
Сортировка
От Volkan YAZICI
Тема Re: SELECT very slow
Дата
Msg-id 7104a7370506090031c8617d3@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SELECT very slow  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-sql
Hi,

On 6/9/05, Thomas Kellerer <spam_eater@gmx.net> wrote:
> No I want the whole result.

As Tom underlined:

On 6/9/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The solution is to use a cursor and FETCH a reasonably
> small number of rows at a time.

AFAIC, query results are stored as arrays in PGresult structures.
Thus, storing huge result sets in a single struct is not very
feasible; although, you can face with theoretical limits like MAX_INT
in the long run. Moreover, it's so rare to see any practical use of
retrieving thousands of rows. If you're getting quite huge sets of
data, you should try grouping them with suitable statements.

IMHO, you should use cursors to fetch a suitable amount of row from
related table and forward it recursively. (Furthermore, I think this
is one of the design goals of FETCH mechanism.)

Although, as I see from most API implementations (like C++, Perl, PHP,
Python and etc.), they use libpq as layer between API and server.
Therefore, you'll probably encounter with every limitation of libpq
with other programming languages out of C too.

Regards.


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Indices and user defined operators
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: SELECT very slow