yiisoft/yii — pull request #1849 by KonovalovMaxim (2012-12-12 12:22:35+00:00)
Title: #1515  Use index support in relations

Use index support in relational queries.
Usage :

```php
$criteria = new CDbCriteria();
$criteria->with =array('products' => array('joinOptions' => 'USE INDEX(someindex)'));
Category::model()->findAll($criteria);
```
in ActiveRecord ->relations() :
```php
public function relations()
{
return array(
'parentCategory' => array(self::BELONGS_TO, 'Category', 'parent_category_id'),
'products' => array(self::HAS_MANY, 'Product', 'category_id','joinOptions'=> 'USE INDEX(someindex)')
);
}

}
```