mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
Added index hints for SQL Server. Improvements to existing query hints for Mysql and Cubrid.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9481 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
eaa1a02adc
commit
3815aece09
19 changed files with 320 additions and 6 deletions
29
classes/db/queryparts/table/MssqlTableWithHint.class.php
Normal file
29
classes/db/queryparts/table/MssqlTableWithHint.class.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
class MssqlTableWithHint extends Table {
|
||||
var $name;
|
||||
var $alias;
|
||||
var $index_hints_list;
|
||||
|
||||
function MssqlTableWithHint($name, $alias = NULL, $index_hints_list){
|
||||
parent::Table($name, $alias);
|
||||
$this->index_hints_list = $index_hints_list;
|
||||
}
|
||||
|
||||
function toString(){
|
||||
$result = parent::toString();
|
||||
|
||||
$index_hint_string = '';
|
||||
foreach($this->index_hints_list as $index_hint){
|
||||
$index_hint_type = $index_hint->getIndexHintType();
|
||||
if(in_array($index_hint_type, array('USE', 'FORCE')))
|
||||
$index_hint_string .= 'INDEX(' . $index_hint->getIndexName() . '), ';
|
||||
}
|
||||
if($index_hint_string != ''){
|
||||
$result .= ' WITH(' . substr($index_hint_string, 0, -2) . ') ';
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue