什么时候应该考虑索引你的sql表? [英] When should you consider indexing your sql tables?

查看:93
本文介绍了什么时候应该考虑索引你的sql表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在考虑索引我的sql表之前应该有多少条记录?

How many records should there be before I consider indexing my sql tables?

推荐答案

没有充分的理由放弃明显的索引(FK等),当您创建表格时。在小型表上使用不必要的索引永远不会明显影响性能,当您的思维进入架构设计时,最好先进行切割。此外,一些索引用于防止重复,无论表大小如何,这都是有用的。

There's no good reason to forego obvious indexes (FKs, etc.) when you're creating the table. It will never noticeably affect performance to have unnecessary indexes on tiny tables, and it's good to take a first cut when your mind is into schema design. Also, some indexes serve to prevent duplicates, which can be useful regardless of table size.

我想你的问题的正确答案是表中的记录数应该与何时创建索引无关。

I guess the proper answer to your question is that the number of records in the table should have nothing to do with when to create indexes.

这篇关于什么时候应该考虑索引你的sql表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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