10月 072012
 

在Tokyotyrant中有支持根据前缀来查询的方式,命令行如下:

tcrmgr list [-port num] [-sep chr] [-m num] [-pv] [-px] [-fm str] host

参数中的-fm 就是要指定的key的前缀,试想:不同的存储方式中,这种操作是怎么实现的呢?

1. 对于hash存储,遍历所有的key,然后和提供的前缀来比较,显然效率是很低的,所以如果有这种需求,就不要使用hash存储

2. 对于tree的存储方式,比hash方式查找要比较的少一些

3. B+tree, 这个就比较快一下,这个是比较适合的存储方式

 Posted by at 下午 1:26

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据