PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid » Bug #8792

Use with Pager_Wrapper?

Details

Request #8792Use with Pager_Wrapper?
Submitted2006-09-26 19:20 UTC
Fromjason at greenhell dot com
Assignedwiesemann
StatusBogus
PackageStructures_DataGrid
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2006-09-26 19:20 UTC] jason at greenhell dot com

Description:
------------
The Pager class includes a wrapper called Pager_Wrapper_DB and Pager_Wrapper_MDB2, which greatly improves performance of the Pager class when used with large result sets. Instead of querying all records, and displaying 20 per page -- Pager_Wrapper performs a COUNT(*) on your SQL query for displaying pagination information, and only returns 20 records (per page limit) using SQL LIMIT which greatly improves performance.

I've looked at DataGrid's HTMLTable Renderer and it's use of the Paging class with the hopes of utilitizing this Pager_Wrapper class, but alas - it seems as if the query is already executed by the time this Renderer is invoked.

DataGrid is an excellent package, but unfortunately it has become extremely slow dealing with large record sets due to due its implementation of pagination.

Is there any chance this ability to improve SQL performance with the use of LIMIT, OFFSET can make it into DataGrid's HTMLTable Renderer?

Thanks!

[2006-10-24 15:50 UTC] olivierg at php dot net

There is a misunderstanding here IMO.

Jason: Structures_DataGrid does not "query all records" for
counting them. It has been using COUNT() and LIMIT for
ages... Your performance problem is coming from something
else.

Mark: I think you're confusing what Jason says with our TODO
item n°5. Please mark this bug as Bogus.

[2006-10-24 16:14 UTC] jason at greenhell dot com

Actually Mark was right. Reading this TODO item is exactly what I was referring to in my comments.

Basically what I meant was:

If you have 10000 rows, and you are displaying 20 per page. DataGrid selects ALL 10000 and displays only 20 instead of selecting only 20 with an SQL LIMIT.