Dropped index hinting support
Never gets used, ended up being somewhat MySQL specific as PostgreSQL favors letting the server handle it instead of hinting at it. Write better queries I suppose?
This commit is contained in:
parent
57a5b0c2c0
commit
68365142e7
1 changed files with 1 additions and 38 deletions
|
@ -132,16 +132,6 @@ class Model extends Object
|
||||||
*/
|
*/
|
||||||
protected $joins = false;
|
protected $joins = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* [Index] Hints
|
|
||||||
*
|
|
||||||
* SQL: USE INDEX
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @var mixed
|
|
||||||
*/
|
|
||||||
protected $hints = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conditions
|
* Conditions
|
||||||
*
|
*
|
||||||
|
@ -748,33 +738,6 @@ class Model extends Object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds the index hints
|
|
||||||
if ($this->hints != false)
|
|
||||||
{
|
|
||||||
if (is_array($this->hints))
|
|
||||||
{
|
|
||||||
foreach ($this->hints as $hint => $columns)
|
|
||||||
{
|
|
||||||
if (is_array($columns))
|
|
||||||
{
|
|
||||||
$this->sql[] = $hint . ' (' . implode(', ', $columns) . ')';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$format = (stripos($columns, 'USE ') === false);
|
|
||||||
|
|
||||||
$this->sql[] = ($format ? 'USE INDEX (' : '') . $columns . ($format ? ')' : '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$format = (stripos($this->hints, 'USE ') === false);
|
|
||||||
|
|
||||||
$this->sql[] = ($format ? 'USE INDEX (' : '') . $this->hints . ($format ? ')' : '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adds the WHERE conditionals
|
// Adds the WHERE conditionals
|
||||||
if ($this->conditions != false)
|
if ($this->conditions != false)
|
||||||
{
|
{
|
||||||
|
@ -1658,7 +1621,7 @@ class Model extends Object
|
||||||
$key = trim(strtolower($key));
|
$key = trim(strtolower($key));
|
||||||
|
|
||||||
// Assigns valid keys to the appropriate class property
|
// Assigns valid keys to the appropriate class property
|
||||||
if (in_array($key, ['fields', 'table', 'joins', 'hints', 'conditions', 'group', 'having', 'order', 'limit', 'offset']))
|
if (in_array($key, ['fields', 'table', 'joins', 'conditions', 'group', 'having', 'order', 'limit', 'offset']))
|
||||||
{
|
{
|
||||||
$this->$key = $value;
|
$this->$key = $value;
|
||||||
$conditions = false;
|
$conditions = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue