开发者

Using an index for a ranged where

im storing down ra开发者_如何学JAVAnks in one of my app, and i frequently do this:

select count(*) from table where score > ?

and ? = the current person's score. i intend to memcache this, and i use an index on this table, is there a good way to index it?


I would create the index on score

Have a look at CREATE INDEX Syntax

It is recomended though to profile a couple of options, and also take into account that this filed might be regularly updated.


yep, index with "score" as left-most part will be used with this query

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜