pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Page Management
3+ messages / 3 participants
[nested] [flat]

* Page Management
@ 2002-02-22 15:13 Samuel J. Sutjiono <ssutjiono@wc-group.com>
  2002-02-22 15:58 ` Re: Page Management Wei Weng <wweng@kencast.com>
  2002-02-22 17:13 ` Re: Page Management Nick Fankhauser <nickf@ontko.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Samuel J. Sutjiono @ 2002-02-22 15:13 UTC (permalink / raw)
  To: pgsql-sql

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Page Management
  2002-02-22 15:13 Page Management Samuel J. Sutjiono <ssutjiono@wc-group.com>
@ 2002-02-22 15:58 ` Wei Weng <wweng@kencast.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Wei Weng @ 2002-02-22 15:58 UTC (permalink / raw)
  To: Samuel J. Sutjiono <ssutjiono@wc-group.com>; +Cc: pgsql-sql

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.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Page Management
  2002-02-22 15:13 Page Management Samuel J. Sutjiono <ssutjiono@wc-group.com>
@ 2002-02-22 17:13 ` Nick Fankhauser <nickf@ontko.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Nick Fankhauser @ 2002-02-22 17:13 UTC (permalink / raw)
  To: Samuel J. Sutjiono <ssutjiono@wc-group.com>; pgsql-sql

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-02-22 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-22 15:13 Page Management Samuel J. Sutjiono <ssutjiono@wc-group.com>
2002-02-22 15:58 ` Wei Weng <wweng@kencast.com>
2002-02-22 17:13 ` Nick Fankhauser <nickf@ontko.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox