From ssutjiono@wc-group.com Fri Feb 22 15:18:14 2002 Received: from qmsql.netservers.net (hpmail1.netservers.net [209.196.128.163]) by postgresql.org (Postfix) with SMTP id 70A70475896 for ; Fri, 22 Feb 2002 10:18:14 -0500 (EST) Received: (qmail 24967 invoked from network); 22 Feb 2002 15:18:18 -0000 Received: from unknown (HELO AARON) (66.26.63.73) by hpmail1.netservers.net with SMTP; 22 Feb 2002 15:18:18 -0000 Message-ID: <01b101c1bbb3$8725dc30$110a010a@headquarters.wcgroup.com> From: "Samuel J. Sutjiono" To: Subject: Page Management Date: Fri, 22 Feb 2002 10:13:47 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01AE_01C1BB89.9DE7EAA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200202/311 X-Sequence-Number: 6733 This is a multi-part message in MIME format. ------=_NextPart_000_01AE_01C1BB89.9DE7EAA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I have a question on page management. I want my web page to display the fir= st 10 rows (of 100 in the result set). If user clicks next page, it execut= es 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_01AE_01C1BB89.9DE7EAA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
I have a question on page management. I wa= nt=20 my web page to display the fir= st 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 records= =20 11-20.  What is the most effi= cient way=20 to accomplish this ?   Should I use LIMIT and OFFSET or Fetch fro= m=20 cursor ?
 
I appreciate any help.=
 
Regards,
Sam
------=_NextPart_000_01AE_01C1BB89.9DE7EAA0-- From wweng@kencast.com Fri Feb 22 15:50:28 2002 Received: from mta1.snet.net (mta1.snet.net [204.60.203.70]) by postgresql.org (Postfix) with ESMTP id 5464E475A86 for ; Fri, 22 Feb 2002 10:50:28 -0500 (EST) Received: from pop.snet.net ([204.60.203.73]) by mta1.snet.net (8.12.1/8.12.1/SNET-smtp-1.1/D-1.1/O-1.1) with ESMTP id g1MFn50G012728; Fri, 22 Feb 2002 10:49:06 -0500 (EST) Received: from kencast.com (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.1/8.12.1/SNET-pop-1.2/D-1.2/O-1.3) with ESMTP id g1MFoNre027326; Fri, 22 Feb 2002 10:50:25 -0500 (EST) Message-ID: <3C766A8F.4020505@kencast.com> Date: Fri, 22 Feb 2002 10:58:07 -0500 From: Wei Weng Reply-To: wweng@kencast.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020205 X-Accept-Language: en-us MIME-Version: 1.0 To: "Samuel J. Sutjiono" Cc: pgsql-sql@postgresql.org Subject: Re: Page Management References: <01b101c1bbb3$8725dc30$110a010a@headquarters.wcgroup.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200202/314 X-Sequence-Number: 6736 Sam: I had done the same thing in a recent project using LIMIT keyword. The performance was quite satisfactory. Samuel J. Sutjiono wrote: > 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 > -- Wei Weng Network Software Engineer KenCast Inc. From nickf@ontko.com Fri Feb 22 17:17:57 2002 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--