mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merged from MOODLE_15_STABLE: Performance fix: in postgres, sometimes indexes are not used because of type casting. block_instance.pageid is a big int field so the index wasn't being used. Wrapping in '' prevents the typecast. See http://www.postgresql.org/docs/7.4/interactive/datatype.html#DATATYPE-INT for more information
This commit is contained in:
parent
85430e94cc
commit
a9b3afb7b1
1 changed files with 1 additions and 1 deletions
|
@ -738,7 +738,7 @@ function blocks_get_by_page_pinned($page) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function blocks_get_by_page($page) {
|
function blocks_get_by_page($page) {
|
||||||
$blocks = get_records_select('block_instance', 'pageid = '. $page->get_id() .' AND pagetype = \''. $page->get_type() .'\'', 'position, weight');
|
$blocks = get_records_select('block_instance', "pageid = '". $page->get_id() ."' AND pagetype = '". $page->get_type() ."'", 'position, weight');
|
||||||
|
|
||||||
$positions = $page->blocks_get_positions();
|
$positions = $page->blocks_get_positions();
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue