On Tue, 29 Jan 2002, Mark Stosberg wrote:

> I have a couple of questions regarding the HTML::Pager module, which
> uses  HTML::Template:
>
> * Has anyone thought about recrafting this as a CGI::Application app?

Dunno.  It has to integrate pretty tightly with the application that uses
it and it only really has one run-mode...  Maybe it could re-designed as a
module that generates a run-mode for a CGI::App.  Um, I wonder how that
would work.

> * From the documentation, it appears that the whole result set needs to
> be available even though I'm just displaying a subset of it. Is this
> correct?

No, just the count of all the results to be paged through.

> I think Postgres and MySQL now both support a better
> alternative using the "LIMIT" feature. I can run one SQL statement to
> find out that I would get back 2000 rows, and a second statement to get
> back only rows 10 through 20 of the result set. Does the current feature
> set support this model.

Right, that's one way to do it.  As an additional optimization I usually
pass that COUNT() result along as hidden field like "rows" so that I don't
have to run two queries for every page.  Basically you just put the
data-fetching SELECT inside your callback and use the offset and length
parameters to seed a LIMIT.

> If so,  could someone provide an example?

Hmmm, let me get back to you on that.  I know I've got one around here
somewhere...

-sam



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to