pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Volkan YAZICI <volkan.yazici@gmail.com>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: SELECT very slow
Date: Thu, 9 Jun 2005 10:31:50 +0300
Message-ID: <7104a7370506090031c8617d3@mail.gmail.com> (raw)
In-Reply-To: <d88ovu$mb8$1@sea.gmane.org>
References: <d87ood$8vq$1@sea.gmane.org>
	<27961.1118275606@sss.pgh.pa.us>
	<42A797B5.3060300@pobox.com>
	<d88ovu$mb8$1@sea.gmane.org>

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.



view thread (19+ messages)  latest in thread

Message-ID: <7104a7370506090031c8617d3@mail.gmail.com>
Permalink:  ../7104a7370506090031c8617d3@mail.gmail.com/
Also on:    postgresql.org/message-id/7104a7370506090031c8617d3@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: volkan.yazici@gmail.com, spam_eater@gmx.net
  Subject: Re: SELECT very slow
  In-Reply-To: <7104a7370506090031c8617d3@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox