Easy way to get totalItemCount for CSqlDataProvider


I use CGridView and i recognized that CDbCriteria is too slow for me (see this topic), so i created a own querybuilder and use the CSqlDataProvider as alternative…

this works really great, it is really fast (needs only one third of the time).

the problem is:

the CSqlDataProvider need the property totalItemCount. I don’t know the totalItemCount before executing my sql statement. I don’t want execute it before only to count the results. Is thre any way to get totalItemCount without executing my query a second time?