Thread: Page Management

Page Management

From
"Samuel J. Sutjiono"
Date:
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

Re: Page Management

From
Wei Weng
Date:
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.




Re: Page Management

From
"Nick Fankhauser"
Date:
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