title: create index for following LARAVEL eloquent query
body: <p>Hi I have more than 500k records in items table Its takes more than 9 seconds to execute this query ineed to make it milliseconds to execute this query using mysql index</p>
  
  <pre><code>$products = \App\items::with([
      'item_store' =&gt; function($query) {
          $query-&gt;select('size', 'item_id', 'item_store_id');
      },
  
      'pics' =&gt; function($query) {
          $query-&gt;select('img_url', 'item_id');
      },
  
      'brand' =&gt; function($query) {
          $query-&gt;select('item_id', 'brand_id');
      },
      'brand.brand' =&gt; function($query) {
          $query-&gt;select('brand_id', 'brand_name');
      }
  
  ])
      -&gt;select('item_id', 'short_name', 'price', 'price_above')
      -&gt;orderBy('Price', 'Asc')-&gt;whereIn('category_id', $arr)
      -&gt;groupBy('Sku')
      -&gt;paginate(20);
  </code></pre>
  
  <p>my database structure is [st] <a href="https://screenshots.firefox.com/JAmaKENMYRhQkEjx/ourweds.com" rel="nofollow noreferrer">https://screenshots.firefox.com/JAmaKENMYRhQkEjx/ourweds.com</a></p>
  
  <p>this is item table migration</p>
  
  <pre><code>Schema::create('item', function (Blueprint $table) {
              $table-&gt;bigIncrements('item_id');
              $table-&gt;string('item_name');
              $table-&gt;integer('Sku');
              $table-&gt;text('Description');
              $table-&gt;text('short_description');
              $table-&gt;text('category_id');
              $table-&gt;string('color');
              $table-&gt;double('price');
              $table-&gt;double('indian_price');
  
             $table-&gt;string('old_price');
  
             $table-&gt;string('indian_old_price');
  
  
              $table-&gt;timestamps();
  
  
          });
  </code></pre>
  
  <p>item  eloquent model</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class items extends Model
  {
      //
  
       protected $table = 'items';
        protected $primaryKey = 'item_id';
  
        protected $fillable = [
         'category_id',
         'item_name',
         'Sku',
         'Description',
         'short_description',
         'color',
         'kik_cash_percentage',
          'status',
            'price',
            'price_old',
            'indian_price',
            'short_name',
            'price_above',
            'short_name_alter',
            'availability'
      ];
  
      public function pics(){
    return $this-&gt;hasOne( 'App\item_pics', 'item_id' );
  }
  
  
   public function item_store()
      {
          return $this-&gt;hasMany('App\item_store','item_id');
      }
  
       public function category()
      {
          return $this-&gt;belongsTo('App\categories','category_id');
      }
  
    public function brand()
      {
          return $this-&gt;hasOne('App\item_has_brand','item_id');
      } 
  
  }
  </code></pre>