using limit instead of seeking

From: admin <admin(at)wtbwts(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: using limit instead of seeking
Date: 1999-12-09 16:13:26
Message-ID: Pine.BSF.4.10.9912091610320.8952-100000@server.b0x.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-12-09 16:24:18 Re: [GENERAL] How to stop implicit rollback on certain errors?
Previous Message David Sauer 1999-12-09 15:25:46 Setting of locales at runtime ?