I am running a very simple query on a indexed column in a 20 mln line table. Select It takes about 22 seconds to be new to SQL, but it seems that a indexed column should be faster than this. There is no memory issue as well, output says that time is mostly in the network. I am running the query on the machine on which the server is running. that What does the network mean? Are you expecting this query to run faster? B> Yes, absolutely must run faster. You may have made one of these common errors: To find out that One more thing that you can do to improve the situation is to avoid using the from * to * prvol where date = '20100203'; Edit: According to the request, there is some output here.
Select Explain * from date of project = '20100203'; "App", "selection", "select", "table", "type", "potential_keys", "key", "key_lan", "referee", "lines", "extra", "1"
make table prol; "Table", "Create Table", "Prol", "Make Table" Prol (`Acch 'varchar (10) default faucet,' ticker 'varchar (10) default null,' date 'date default call,' open ' Float unsigned default null, `high` float unsigned default null, floating unsigned default null, float unsigned default null, float unsigned default null, 'echo' float default faucet, 'key' index 1 `Date`)) engine = INNO DB default charset = Latin 1 "
date column . date column is not the first column in the index and therefore can not be used for this query. play table project is created and post the output.
SELECT * . Always select only the columns. Even if you feel that you need all the columns, then in the event of a change in schema in the future, of course, they should definitely be listed for safety.
Comments
Post a Comment