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:
+1
-1
@@ -598,7 +598,7 @@ function blocks_execute_repositioning(&$instance, $newpos, $newweight) {
|
||||
}
|
||||
|
||||
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();
|
||||
$arr = array();
|
||||
|
||||
Reference in New Issue
Block a user