何时索引,在Mongoid中索引什么? [英] When to index, what to index in Mongoid?

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

问题描述

我对索引有点新意,但我很好奇索引的用例。 (我假设它对索引字段的查询速度要快得多。)是否有标准来确定索引内容和索引时间?我应该期待什么样的性能优势 - 特别是在Rails应用程序中使用Mongoid和MongoDb?

I'm a bit new to indexes, but I am curious about the usecases for an index. (I assume it makes queries on the indexed fields much faster.) Is there a criteria for determining what to index and when to index? What kind of performance benefits should I expect -- specifically using Mongoid with MongoDb on a Rails app?

推荐答案

查看索引 MongoDB文档和索引建议和常见问题解答,这里有很多很棒的信息。

Check out Indexes MongoDB docs and Indexing Advice and FAQ, lots of great info here.

这篇关于何时索引,在Mongoid中索引什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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