I have a huge mysql database with arround 500,000 records. All the records have a date field. Every day like 100 records been added in the database with date.
I am getting this data using select query in different forms like current week, month, year and all from beginning data and save it as a text file
Now the problem I am having is with the select query
if I write a a simple query like select a,b,c from tablename where date='00-00-0000' .................. works fine get the data
getting the weekly, and monthly data works fine and the text file generated very quick. The records till one month arround 2000 to 2500
But when I try to get the whole year recors that are arround 35,000 to 45,000 the query take so much time and at the end gives me the executin timeout error.
Same thing happen If I need the all records in the table and want to store in text file.
There is only one table with 5 fields in it.
What is the simplest way to acchieve it. I need to get all the records from the table using a select query and insert in textfile.
please help