5.22

[size=medium][rails db indexing]

[url=http://geekskillz.com/articles/16]Using Indexes to Improve Rails Performance[/url]
谈到了如何正确用index 何时用用哪一个如何用
If you measure your database performance in seconds rather than milliseconds, then it might be time to look at all your queries and indexes to see if you’re missing something.

Having indexes improves query performance, but can hurt other kinds of database
operations: inserts, updates, and deletes. If your app changes the data in your
database frequently, then you need to consider the performance penalties of
indexes on those operations.When table data changes, all the indexes need to be
updated. You’ll have to find a balance between query performance and transaction
performance. Some testing and measurements may be needed. Once you create a
fifth or sixth index on a table, you should really stop and think about it. What
kinds of :conditions are you using in your queries? Can they be changed to use
existing indexes? If your database is almost entirely used for queries, not
transactions, then have no fear. Indexes are what you want. In practice, indexes
will have negligible impact on create, read, and delete operation performance.


Also, the on-disk size of an index depends on the columns of that index. So, if you’ve got a string column that has a length measured in hundreds or thousands, than you should probably not include it in an index. Your VARCHAR(32000) columns are not the best candidates for indexes. Use them only if you have a very good reason.
----

[Community]

[url=http://blog.objectmentor.com/articles/2009/05/11/why-the-sea-is-boiling-hot]Why the sea is boiling hot[/url]
又见口水仗 DHH的任务之一就是把水搅浑 哈哈 不过暂不论两方的论点 像DHH这样的strong
opionated的leader还是很必要的 无论他是错误的还是正确的 很多观念在这样的争执中得
到了更大程度的曝光
----
[rails mailer GAP]

[url=http://www.danielfischer.com/2008/01/09/how-to-use-gmail-as-your-mail-server-for-rails/]How To: Use GMail as your mail server for Rails 2.0![/url]
----

[/size]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值