I am executing a mysql query for searching car information from a table having 530399 records
for Executing query it is taking so much time
SELECT c.* FROM CarInfo as c WHERE (c.Vehicle_Year<='2014') and c.Vehicle_Age_Type='USED' limit 0,15 .
I need all the fields from table so using * .
My table have 36 columns . Is there any way to optimize this query .
After adding index it is loading fast with limit but its taking time when trying to use total count
SELECT count(*) as total FROM CarInfo as c WHERE (c.Vehicle_Year<='2014') and c.Vehicle_Dealer_Zip in(85320,85354,85541) and (c.Vehicle_age_type='New' or c.Vehicle_age_type='Used' or c.Vehicle_age_type='Certified Used')
Dealer_Zip may contain so may values.
Thanks in advance.