pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nick Fankhauser <nickf@ontko.com>
To: Samuel J. Sutjiono <ssutjiono@wc-group.com>
To: pgsql-sql@postgresql.org
Subject: Re: Page Management
Date: Fri, 22 Feb 2002 12:13:49 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGIEKNEGAA.nickf@ontko.com> (raw)
In-Reply-To: <01b101c1bbb3$8725dc30$110a010a@headquarters.wcgroup.com>

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

view thread (3+ messages)

Message-ID: <NEBBLAAHGLEEPCGOBHDGIEKNEGAA.nickf@ontko.com>
Permalink:  ../NEBBLAAHGLEEPCGOBHDGIEKNEGAA.nickf@ontko.com/
Also on:    postgresql.org/message-id/NEBBLAAHGLEEPCGOBHDGIEKNEGAA.nickf@ontko.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: nickf@ontko.com, ssutjiono@wc-group.com
  Subject: Re: Page Management
  In-Reply-To: <NEBBLAAHGLEEPCGOBHDGIEKNEGAA.nickf@ontko.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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