Re: large table problem - Mailing list pgsql-general

From Tom Lane
Subject Re: large table problem
Date
Msg-id 22832.1177105923@sss.pgh.pa.us
Whole thread Raw
In response to large table problem  ("Jason Nerothin" <jasonnerothin@gmail.com>)
List pgsql-general
"Jason Nerothin" <jasonnerothin@gmail.com> writes:
> Attempt number 2, now underway, is to pass
> LIMIT and OFFSET values to the query which Postgres handles quite
> effectively as long as the OFFSET value is less than the total number of
> rows in the table. When the value is greater than <num_rows>, the query
> hangs for minutes.

I don't actually believe the above; using successively larger offsets
should get slower and slower in a smooth manner, because the only thing
OFFSET does is throw away scanned rows just before they would have been
returned to the client.  I think you've confused yourself somehow.

> the documentation suggests that cursor behavior is a little buggy for the
> current postgres driver.

How old a driver are you using?  Because a cursor is definitely what you
want to use for retrieving millions of rows.

It strikes me that pgsql-jdbc might be a more suitable group of people
to ask about this than the -general list ...

            regards, tom lane

pgsql-general by date:

Previous
From: Vladimir Zelinski
Date:
Subject: Re: unique constraint on 2 columns
Next
From: Jonathan Vanasco
Date:
Subject: Re: unique constraint on 2 columns