using limit instead of seeking - Mailing list pgsql-general

From admin
Subject using limit instead of seeking
Date
Msg-id Pine.BSF.4.10.9912091610320.8952-100000@server.b0x.com
Whole thread Raw
Responses indices don't make much difference  (admin <admin@wtbwts.com>)
List pgsql-general
Would there be any reasonable performance gain in using LIMIT in an sql
query to print pages of results, instead of seeking to the desired record
and printing a number of records in a while loop?

I have tried both options, but I cannot perceive any significant change in
performance. Is there a way I can actuall test or predict the usefulness
of using one alternative over the other? I am also using SORT in my sql
queries, so perhaps the db server will have to retrieve all records
beforehand anyways in order to perform the sort. In such a case, I guess
using LIMIT wouldn't make much of a difference. On the other hand, there
are perhaps cases when using LIMIT would make a difference.

Any guidance would be appreciated to solving this problem.
Thanks in advance,
Marc



pgsql-general by date:

Previous
From:
Date:
Subject: Re: [GENERAL] get the previous assigned sequence value
Next
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] Suggested "minor" change to psql