Cgridview And Large Datasets

After lots of searching it is a common recommendation

to use DAOand Query Builder for large datasets instead of ActiveRecord

So far so good.

But what, if I want to use those results in a CGridView ?

(which in case of DAO are of type Array when using queryAll() )

CGridView accepts only CActiveDataProvider as input.

Is there a "mechanism" to create CActiveDataProvider from an array ?

Thanks in advance

CGridView takes any CDataProvider derived class. You can see the provided subclasses at the top of that page.

You’re probably after CArrayDataProvider.

Hmmm, it seems that the problem is not which type of DataProvider I use.

Regardless of which I use (CArrayDataProvider,CActiveDataProvider,CSqlDataProvider etc.)

I always get the error : Fatal error: Allowed memory size of xxxxxxxxx bytes exhausted

Limit and pagination may seem out of question ,cause I want all records returned on one page , due

to the requirement of selecting some records (via checkbox) and do some other processing on them.

So CGridView can’t handle large amounts of data without pagination ?

How many rows and columns are you dealing with?

You should still consider pagination. If you manage to get, say, 10,000 records to display at once, then try to perform bulk actions on all of them, you’re going to hit serious performance problems. At worst, you’ll end up performing the action on part of the set, then running out of memory or timing out, leaving your data in an inconsistent state.

Try it with a high number of items per page if necessary (such as 500), and just do the actions in batches.

Thanks a lot Keith