Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix performance issues in JModelLegacy::_getListCount() #1532
Current code in JModelLegacy::_getListCount() forces database engine to fetch all items instead of just counting them. With hundreds of thousands or millions of rows the query gets very inefficient even if no results are actually fetched by the function.
Cloning and modifying JDatabaseQuery object into COUNT(*) allows database engine to do optimizations that will considerably speed up the code even with very simple queries like:
if there are hundreds of thousands of users.