mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 15:22:15 +09:00
Added index hints for CUBRID and Mysql.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9472 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0b8949cfeb
commit
96b60466be
18 changed files with 350 additions and 4 deletions
|
|
@ -28,6 +28,9 @@
|
|||
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpression.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/Table.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/JoinTable.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/CubridTableWithHint.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/MysqlTableWithHint.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/IndexHint.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/condition/ConditionGroup.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/condition/Condition.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/condition/ConditionWithArgument.class.php');
|
||||
|
|
@ -557,6 +560,15 @@
|
|||
$where = $query->getWhereString($with_values);
|
||||
if($where != '') $where = ' WHERE ' . $where;
|
||||
|
||||
$tableObjects = $query->getTables();
|
||||
$index_hint_list = '';
|
||||
foreach($tableObjects as $tableObject){
|
||||
if(is_a($tableObject, 'CubridTableWithHint'))
|
||||
$index_hint_list .= $tableObject->getIndexHintString() . ', ';
|
||||
}
|
||||
if($index_hint_list != '')
|
||||
$index_hint_list = 'USING INDEX ' . substr($index_hint_list, 0, -2);
|
||||
|
||||
$groupBy = $query->getGroupByString();
|
||||
if($groupBy != '') $groupBy = ' GROUP BY ' . $groupBy;
|
||||
|
||||
|
|
@ -566,7 +578,7 @@
|
|||
$limit = $query->getLimitString();
|
||||
if($limit != '') $limit = ' LIMIT ' . $limit;
|
||||
|
||||
return $select . ' ' . $from . ' ' . $where . ' ' . $groupBy . ' ' . $orderBy . ' ' . $limit;
|
||||
return $select . ' ' . $from . ' ' . $where . ' ' . $index_hint_list . ' ' . $groupBy . ' ' . $orderBy . ' ' . $limit;
|
||||
}
|
||||
|
||||
function getDeleteSql($query, $with_values = true){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue