将索引应用于数据库列将影响代码C#中的查询 [英] Apply index to database column will affect queries in code C#

查看:71
本文介绍了将索引应用于数据库列将影响代码C#中的查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mysql中实现了我的数据库而没有对它应用任何索引。但现在我想为键列添加索引。但有一个问题,是数据库查询会改变哪些是用c#代码编写的。



我尝试了什么:



我在mysql中实现了我的数据库而没有应用任何索引

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

推荐答案

引用:

数据库查询将改变用c#代码编写的内容。

database queries will change which are written in c# code.

实际上,它通常是相反的方式。您将需要查看查询,然后根据查询创建索引。所以不,你的查询不会改变。



查看你在WHERE子句中使用的列以及ORDER BY的哪些字段。这些是索引编制的好选择。但是你不想只是在没有理由或需要的情况下添加索引。

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.


这篇关于将索引应用于数据库列将影响代码C#中的查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆