本文介绍了有很多指数的缺点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近通过给SQLite一个很好的索引来处理一个复杂的查询一个数量级。像这样的结果让我想知道我是否应该索引很多其他字段通常用于JOINS或ORDER BY子句。但我不想得到过分热情,让我反感:我假设有一些原因创建索引,或每个字段将被默认索引。

I recently sped up a complicated query by an order of magnitude by giving SQLite a good index to work with. Results like this make me wonder if I should index a lot of other fields that are commonly used for JOINs or ORDER BY clauses. But I don't want to get overzealous and have it backfire on me: I assume there must be some reasons not to create indices, or every field would be indexed by default.

我在这种情况下使用SQLite,但是当然也欢迎DBMS-agnostic的建议。

I'm using SQLite in this case, but of course DBMS-agnostic advice is welcome as well.

推荐答案

索引会减慢插入和更新(这可能会成为一个非常严重的问题与锁定)和成本磁盘空间。这是很多。

Indexes slow down inserts and updates (which can become a really serious issue with locking) and cost disk space. That's pretty much it.

这篇关于有很多指数的缺点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 06:17