Skip to content

Commit e36c537

Browse files
committed
Switch from LEFT to INNER joins.
INNER joins are often more efficient as they can result in fewer rows being examined before a result set is generated. Fixes #3968
1 parent dc15c78 commit e36c537

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Cake/Model/AclNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function node($ref = null) {
8585
'joins' => array(array(
8686
'table' => $table,
8787
'alias' => "{$type}0",
88-
'type' => 'LEFT',
88+
'type' => 'INNER',
8989
'conditions' => array("{$type}0.alias" => $start)
9090
)),
9191
'order' => $db->name("{$type}.lft") . ' DESC'
@@ -97,7 +97,7 @@ public function node($ref = null) {
9797
$queryData['joins'][] = array(
9898
'table' => $table,
9999
'alias' => "{$type}{$i}",
100-
'type' => 'LEFT',
100+
'type' => 'INNER',
101101
'conditions' => array(
102102
$db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft"),
103103
$db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght"),

0 commit comments

Comments
 (0)