title: Is there any way to optimize this MYSQL query
body: <p>I have a MySql Table with the following schema.</p>
  
  <pre><code>table_products - "product_id", product_name, product_description, product_image_path, brand_id
  table_product_varient - "product_id", "varient_id", product_mrp, product_sellprice, product_imageurl
  table_varients - "varient_id", varient_name
  table_product_categories - "product_id", "category_id"
  </code></pre>
  
  <p>and this is the Mysql <code>select</code> query i am using to fetch the data for the category user provided.</p>
  
  <pre><code>select * from table_products, table_product_varients, table_varients, table_product_categories where table_product_categories.category_id = '$cate_id' &amp;&amp; table_product_categories.product_id = table_products.product_id &amp;&amp; table_products.product_id = table_product_varients.product_id &amp;&amp; table_varients.varient_id = table_product_varients.varient_id
  </code></pre>
  
  <p>The problem is that, as table contains lot of products, and each product contains lot of varients, it is taking too much time to fetch the data. And i doubt, as data will grow, the time will increase to fetch the items. Is there any optimized way to achieve the same.</p>
  
  <p>Your help will be highly appreciated.</p>
  
  <p>Devesh</p>