Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks

From: "Olexandr Melnyk" <omelnyk(at)gmail(dot)com>
To: "[PostgreSQL General]" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks
Date: 2008-06-27 20:29:03
Message-ID: d5f60f0c0806271329w5bc10c0ay75c17bc57c1004b0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/27/08, Bill Thoen <bthoen(at)gisnet(dot)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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma 2008-06-27 21:01:14 Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks
Previous Message Lennin Caro 2008-06-27 20:23:07 Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks