title: How to Speed Up the performance of web application developed by using Yii 2.0 Framework
body: <p>Actually i need to increase the performance speed in my web application developed by using Yii 2 .0 Framework</p>
  
  <p>I have made a CRM using Yii2 Framework, That contains a <em>large database</em>, in that database particular table called <code>Employee</code> contains 20,000 employee records, so while executing query to retrieve data from table, it takes time to execute.</p>
  
  <p>This makes it troublesome for me to use this application.</p>
  
  <p>UPDATED
  code:</p>
  
  <pre><code>public function actionLists($id)
      {
           $countClaimprocess = Employee::find()
              -&gt;where(['id' =&gt; $id])
              -&gt;count();
  
      $claimprocess1 = Employee::find()
              -&gt;select('employee_id')
              -&gt;where(['id' =&gt; $id])
              -&gt;one();
  
      $claimprocess2 = Employee::find()
              -&gt;select('importcompany_id')
              -&gt;where(['id' =&gt; $id])
              -&gt;one();
  
      $claim2 = $claimprocess2-&gt;importcompany_id;
  
      $claim = $claimprocess1-&gt;employee_id;
  
      $claimprocess = Employee::find()
              -&gt;where("employee_id = '$claim'  and importcompany_id = $claim2")
              -&gt;andwhere(" status != 'Deleted' ")
              -&gt;all();
  
      }
  </code></pre>
  
  <p>The  above code is used for a dependent dropdown, that means if a admin select a <code>company_name</code>, it will show a dependent <code>employee_code</code> belonging to that <code>company</code>, and then again admin selects a <code>employee_code</code>, it will show the dependent <code>employee_name</code> and their <code>family</code> members name.</p>