I have a big table which contains about 100 million records in MySQL. I want to read all the records from it and process them in my C#/.Net program, so I wrote some code like this:
string sql = "SELECT * FROM the_table";
MySqlCommand cmd = new MySqlCommand(sql, conn);
MySqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
//...
}
But after running for 3 minutes, a timeout problem occurs.
If I change the SQL statement to use "limit":
string sql = "SELECT * FROM the_table limit 60000000" //60 million
then it works OK. (the loop while (rdr.Read()) took about 3.8 minutes)
Was the timeout caused because the table was too big?
What's going on here and how do I fix the problem?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)