Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks - Mailing list pgsql-general

From Olexandr Melnyk
Subject Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks
Date
Msg-id d5f60f0c0806271329w5bc10c0ay75c17bc57c1004b0@mail.gmail.com
Whole thread Raw
In response to Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks  (Bill Thoen <bthoen@gisnet.com>)
Responses Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks  (Bill Thoen <bthoen@gisnet.com>)
List pgsql-general
On 6/27/08, Bill Thoen <bthoen@gisnet.com> wrote:
What I want to do is present the results of a query in a web page, but only 10 rows at a time. My PostgreSQL table has millions of records and if I don't add a LIMIT 10 to the SQL selection, the request can take too long. The worst case scenario is when the user requests all records without adding filtering conditions (e.g. SELECT * FROM MyTable;)  That can take 10-15 minutes, which won't work on a web application.


Also note, that huge OFFSET value can slow down the query as much as if you weren't using LIMIT at all.

--
Sincerely yours,
Olexandr Melnyk <><
http://omelnyk.net/

pgsql-general by date:

Previous
From: Lennin Caro
Date:
Subject: Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks
Next
From: Ragnar
Date:
Subject: Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks