Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I implemented my database in mysql without applying any indexing to it.but now i want to add indexing to key columns. but there is one question, is database queries will change which are written in c# code.

What I have tried:

I implemented my database in mysql without applying any indexing to it
Posted
Updated 13-May-16 4:55am

1 solution

Quote:
database queries will change which are written in c# code.
Actually, it's usually the other way around. You will want to look at your queries and then create indexes based on your queries. So no, your queries will not likely change.

Look at which columns you are using in your WHERE clause and which fields you ORDER BY. Those are good candidates for indexing. But you don't want to just add indexes without there being a reason or need for it.
 
Share this answer
 
Comments
Kishor-KW 13-May-16 11:02am    
thats great thank you. will you please tell how much my searching speed will increament. And what to do if there are two or three columns in where clause?

thank you
ZurdoDev 13-May-16 11:12am    
There is no way we can tell you that. It depends on so many things: processing power of your server, other requests it is handling, your data, etc, etc.

In SSMS in a new query window put your sql in there and then click Query, Display Estimated Execution Plan. That will run your query and it will show you how sql is processing it. Then go from there.
Foothill 13-May-16 13:35pm    
To understand the performance impact of database indexes, I would suggest that you read up on what indexes are and the basics of their function.

https://en.wikipedia.org/wiki/Index_%28database%29
https://en.wikipedia.org/wiki/Binary_search_tree
https://en.wikipedia.org/wiki/Divide_and_conquer_algorithms

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900