SSDB 数据库遍历的方法
🕚 by pyList at 2014-07-27 22:17
SSDB 是一个高性能的支持丰富数据结构的 NoSQL 数据库,它的遍历方法也比较简单。
SSDB 数据库
数据库 SSDB 底层是 LevelDB,key 在保存时是排序的,这就给遍历操作提供便利。
k-v 遍历
scan key_start key_end limit
参数
key_start - 返回的起始 key(不包含), 空字符串表示 -inf.
key_end - 返回的结束 key(包含), 空字符串表示 +inf.
limit - 最多返回这么多个元素.
hashmap 遍历
scan name key_start key_end limit
参数
name - hashmap 的名字.
key_start - 返回的起始 key(不包含), 空字符串表示 -inf.
key_end - 返回的结束 key(包含), 空字符串表示 +inf.
limit - 最多返回这么多个元素.
zset 遍历
zscan name key_start score_start score_end limit
参数
name - zset 的名字.
key_start - score_start 对应的 key.
score_start - 返回 key 的最小权重值(可能不包含, 依赖 key_start), 空字符串表示 -inf.
score_end - 返回 key 的最大权重值(包含), 空字符串表示 +inf.
limit - 最多返回这么多个元素.
逆向遍历
上面是正向遍历,按key 从小到大遍历,每种类型数据都有对应的逆向遍历(key 从大到小遍历),rscan
、hrscan
、zrscan
。
遍历性能
由于SSDB 是根据游标来开始获取数据,当数据量很大时,数据遍历的性能也不受影响。
本文网址: https://pylist.com/t/1406470664 (转载注明出处)
如果你有任何建议或疑问可以在下面 留言
发表第一条评论!
相关推荐
小工具
标签
ssdb
数据库
合并
方法
设计
结构
python
sqlite
提速
经验
js
全屏
浏览器
实现
xor
解密
加密
python2
centos
升级
系统
索引
优化
知识
缓存
分享
一个
client
推荐
goji
log
关闭
硬件加速
ubnt
er
固件
路由
默认值
struct
设置
google
身份验证
authenticator
迁移
手机
低功耗
web
爬虫
服务器
组装
格式
转换
常见
时间
chrome
server
ubuntu
debian
浏览
openwrt
国内
cjson
lua
module
错误
解决
os
popen
超时
之坑
files
golang
open
服务
互转
简体
繁体
opencc
网页
文本
正文
提取
新闻
tornado
跨域
ajax
处理
uploadifive
formdata
uploadify
动态
编译
failed
load
devtools
sourcemap
自动更新
microsoft
mac
app
store
登录
未知
静音
风扇
主机
笔记本
改造
微信
尝鲜
视频
体验
cpu
查看
温度
webdriver
微博
selenium
gnu
linux
安装
系统启动
usb
宅家
坑记
屏幕
动手
nginx
quic
抢先
最近发表
- Chrome 控制台 DevTools failed to load SourceMap 警告的消除方法
- Mac 关闭 Microsoft 自动更新
- Mac 登录 App Store 出现“发生了未知错误”的解决方法
- 老笔记本改造为无风扇静音主机方案
- 自己组装21瓦低功耗家庭爬虫、文件、web服务器
- 微信视频号尝鲜体验
- Ubuntu/Debian 查看CPU温度的方法
- 在Ubuntu/debian Server 系统使用Chrome 无头浏览模式
- 换手机后 Google 身份验证器 Google Authenticator 数据迁移的简单方法
- 使用Golang selenium WebDriver 自动登录微博
- 在 Ubuntu 或其它 GNU/Linux 系统下安装 Debian
- Mac 下制作 USB ubuntu/debian 系统启动、安装盘的几种方法
- ubuntu/debian 下自行编译 OpenWRT 固件
- 宅家自己动手换手机屏幕掉坑记
- 路由 UBNT ER-X 官方固件升级及开启硬件加速的方法
- 在 Nginx 和 Golang web 上抢先体验 QUIC
最近浏览
- 路由 UBNT ER-X 官方固件升级及开启硬件加速的方法
- go struct 设置默认值
- 换手机后 Google 身份验证器 Google Authenticator 数据迁移的简单方法
- 用python 实现XOR 加密解密的方法
- 自己组装21瓦低功耗家庭爬虫、文件、web服务器
- python 常见的时间格式转换
- 在Ubuntu/debian Server 系统使用Chrome 无头浏览模式
- OpenWrt 国内源
- 出现 lua module 'cjson' not found 错误的解决方法
- python 解决os.popen 超时问题
- Golang 服务之坑:too many open files
- Golang结合OpenCC实现高效的中文简体繁体互转
- 利用文本及符号密度来提取新闻网页正文
- tornado ajax 跨域处理
- 在 uploadify/uploadifive 上动态设置 formData
- ubuntu/debian 下自行编译 OpenWRT 固件