How can I increase the speed of the query which has multiple Where conditions and Order By.
Posted on 2014-09-12
I have stored all the Permutations and combinations of all the attributes necessary to create a product based on color,weight and quality and stored it in attribute table.
In program I loop on the data from this table and create Select sql to query another table which contains Product Price based on the attributes and I store it in another table.
I have suppose 7000 records in attribute table and 2 Lakh records in Price table.
So the program loops to 7000 records and Each select SQL queries 2Lakh records.
Select SQL contains Multiple Where Clauses and a Order by on Price to get the lowest price.
My question is how can I reduce the query execution time.