MDL-78030 dml: get total count records using the window function
The COUNT window function can be helpful to fasten the complex query, but it's not recommended to be used for a single table query. The patch is specifically for PostgreSQL, MariaDB and Oracle databases as they have better performance compared to MySQL and MSSQL. Although these databases support the COUNT window functions, the results indicate that the query runs slower when using them.
This commit is contained in:
@@ -1722,4 +1722,13 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
public function is_fulltext_search_supported() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Postgresql supports the COUNT() window function and provides a performance improvement.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_count_window_function_supported(): bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user