Acceptable mysql select speed as per documentation?

265 Views Asked by At

Is there an acceptable speed as in this many records per second for MySQL SELECT? I know it depends on how complex the query is and my machine spec. But can I have a vague/approximate speed estimation of a standard SELECT query? May be for something like this:

SELECT a, b, c, d, e, f FROM my_table;

I use .NET connector to access MySQL; from my code I do something like this:

MySqlCommand cmd = new MySqlCommand(query, _conn);
MySqlDataReader r = cmd.ExecuteReader();

List<int> lst = new List<int>();
while (r.Read())
{
    lst.Add(.....
}

r.Close();

Currently I can SELECT 25000 records under 150 ms. But when I run it under phpmyadmin it takes about 75 ms. From MySQL console it neeed less than 50 ms. Is there a need not be worried about limit that documentation recommends be it via connector, console or anything? I am running on an Intel Core2 Duo (2 GHz) with 2 Gb RAM. Speed is critical for my need.

I remember reading one such somewhere..

1

There are 1 best solutions below

2
On

First of all, how are you connecting to your database? Is it a connection to localhost or is the data transferred through your network? If it's not the second option, I can imagine your query would return its results a bit slower.

On the other hand, the MySQL .NET connector is an extra layer between the query and the database itself. Because there are more actions needed before the query is executed (like connecting to the database and adding the results to a list), this could take longer than the time PHPMyAdmin needs.

Edit: I noticed the post date after I posted my comment...