Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by postgresql.org (Postfix) with ESMTP id 35A29476413 for ; Fri, 22 Feb 2002 12:17:57 -0500 (EST) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id MAA07159; Fri, 22 Feb 2002 12:18:01 -0500 X-Authentication-Warning: shire.ontko.com: Host bilbo.ontko.com [199.164.165.101] claimed to be nick Reply-To: From: "Nick Fankhauser" To: "Samuel J. Sutjiono" , Subject: Re: Page Management Date: Fri, 22 Feb 2002 12:13:49 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000E_01C1BB9A.626309E0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-Reply-To: <01b101c1bbb3$8725dc30$110a010a@headquarters.wcgroup.com> Importance: Normal X-Archive-Number: 200202/320 X-Sequence-Number: 6742 This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C1BB9A.626309E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Sam- The answers probably vary a lot depending on the tools you're using to get the info to the web. We use JDBC+Servlets, and our approach to this is to limit the queries to 1000, and then just keep the whole ResultSet and page through it in our servlet without hitting the database again. -NickF -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Samuel J. Sutjiono Sent: Friday, February 22, 2002 10:14 AM To: pgsql-sql@postgresql.org Subject: [SQL] Page Management Hello, I have a question on page management. I want my web page to display the first 10 rows (of 100 in the result set). If user clicks next page, it executes the same SQL (in Stored Procedure) and displays records 11-20. What is the most efficient way to accomplish this ? Should I use LIMIT and OFFSET or Fetch from cursor ? I appreciate any help. Regards, Sam ------=_NextPart_000_000E_01C1BB9A.626309E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Sam-
 
The=20 answers probably vary a lot depending on the tools you're using to get the = info=20 to the web. We use JDBC+Servlets, and our approach to this is to limit the= =20 queries to 1000, and then just keep the whole ResultSet and page through it= in=20 our servlet without hitting the database again.
 
-NickF
 
-----= Original=20 Message-----
From: pgsql-sql-owner@postgresql.org=20 [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Samuel J.=20 Sutjiono
Sent: Friday, February 22, 2002 10:14 AM
To:= =20 pgsql-sql@postgresql.org
Subject: [SQL] Page Management

Hello,
 
I have a question on page management. I = want=20 my web page to display the f= irst 10=20 rows (of 100 in the result set).  If user clicks next page, it= =20 executes the same SQL (in Stored Procedure) and displays record= s=20 11-20.  What is the most ef= ficient=20 way to accomplish this ?   Should I use LIMIT and OFFSET or Fet= ch=20 from cursor ?
 
I appreciate any help.
 
Regards,
Sam
------=_NextPart_000_000E_01C1BB9A.626309E0--