Fix for a performance issue when getting the total row count when implementing...
Fix for a performance issue when getting the total row count when implementing paging. When dealing with about 250.000 rows, it was taking about 30 secs to show one page on the first load. With this modifications it executes almost instantly. The problem was that the query applying .count() to the current query generated the SQL: SELECT count(*) AS count_1 FROM ( SELECT ModelView-columns FROM ModelView-table WHERE conditions ) as anon_1; which made it actually get all the data in the inner query for then counting the rows and returning the amount. With this modification, the generated query is: SELECT count(*) AS count_1 FROM ModelView-table WHERE conditions; that executes instantly.
Showing
Please register or sign in to comment