Reputation: 2884
I have a table in my sql with a 1000 of data and I am using the following sql query
select entityID,name from entity where DataItemId=2020
but it takes around 40 or 50 sec to extract the data and it is not acceptable
Upvotes: 1
Views: 123
Reputation: 5712
You can create an Index on your search column if it is not the primary key column. It will increase the performance Check this for MySQL Indexing
Upvotes: 1
Reputation: 11841
To improve performance, create an index
on DataItemId. If DataItemId is the identity column, make it the primary key
.
Upvotes: 1
Reputation: 44854
You should create an index on the DataItemId column.
see http://dev.mysql.com/doc/refman/5.0/en/create-index.html
This type of query should have sub-second performance
Upvotes: 3