Redis SORT排序命令使用方法詳解(2)_MySQL教程
推薦:mysql多表隨機(jī)查詢優(yōu)化方案我以前介紹過最多的就是單表隨機(jī)查詢時的優(yōu)化了,今天 看到一站長分享了一個多表隨機(jī)查詢優(yōu)化的一些方法與方案,下面我們就一起來看看吧. 本文主要談?wù)撊绾螌崿F(xiàn)Mysql的隨機(jī)查詢,多表隨機(jī)查詢。在Mysql中隨機(jī)取出一條記錄的實現(xiàn)方法。 我們通常的查詢是沒有where或者wh
ZRANGEBYSCORE key min max 返回所有符合score >= min和score <= max的成員 ZCARD key 返回有序集合的元素數(shù)量 ZSCORE key element 返回指定成員的SCORE值 ZREMRANGEBYSCORE key min max 刪除符合 score >= min 和 score <= max 條件的所有成員
6,hash類型
Command Parameters Description
HSET key field value Set the hash field to the specified value. Creates the hash if needed.
HGET key field Retrieve the value of the specified hash field.
HMGET key field1 … fieldN Get the hash values associated to the specified fields.
HMSET key field1 value1 … fieldN valueN Set the hash fields to their respective values.
HINCRBY key field integer Increment the integer value of the hash at key on field with integer.
HEXISTS key field Test for existence of a specified field in a hash
HDEL key field Remove the specified field from a hash
HLEN key Return the number of items in a hash.
HKEYS key Return all the fields in a hash.
HVALS key Return all the values in a hash.
HGETALL key Return all the fields and associated values in a hash.
7,排序(List, Set, Sorted Set)
SORT key BY pattern LIMIT start end GET pattern ASC|DESC ALPHA 按照指定模式排序集合或List
SORT mylist DESC 降序
SORT mylist LIMIT 0 10 從序號0開始,取10條
SORT mylist LIMIT 0 10 ALPHA DESC 按首字符排序
SORT mylist BY weight_* STORE resultkey 將返回的結(jié)果存放于resultkey序列(List)
8,持久控制
SAVE 同步保存數(shù)據(jù)到磁盤
BGSAVE 異步保存數(shù)據(jù)到磁盤
LASTSAVE 返回上次成功保存到磁盤的Unix時間戳
SHUTDOWN 同步保存到服務(wù)器并關(guān)閉 Redis 服務(wù)器(SAVE+QUIT)
BGREWRITEAOF 當(dāng)日志文件過長時重寫日志文件
9,遠(yuǎn)程控制命令
INFO 提供服務(wù)器的信息和統(tǒng)計信息
MONITOR 實時輸出所有收到的請求
SLAVEOF 修改復(fù)制選項
分享:通過frm&ibd 恢復(fù) Mysql ibdata 丟失或損壞的數(shù)據(jù)教程有時候mysql沒有做好數(shù)據(jù)備份,或者被數(shù)據(jù)管理員誤刪,或者ibdata損壞了我們?nèi)绾位謴?fù)呢?別怕,只要有部分frm、ibd存在,下面就是恢復(fù)教程。 mysql存儲在磁盤中,各種天災(zāi)人禍都會導(dǎo)致數(shù)據(jù)丟失。大公司的時候我們常常需要做好數(shù)據(jù)冷熱備,對于小公司來說要做好所有數(shù)據(jù)
- mysql多表隨機(jī)查詢優(yōu)化方案
- 通過frm&ibd 恢復(fù) Mysql ibdata 丟失或損壞的數(shù)據(jù)教程
- mysql數(shù)據(jù)庫ROOT賬號權(quán)限丟失問題解決方法
- hash和solr在海量數(shù)據(jù)分布式搜索引擎中的應(yīng)用教程
- 23道安全門加鑄MySQL數(shù)據(jù)庫
- MySQL 5.0 數(shù)據(jù)庫新特性的存儲過程
- MySql管理的一點心得
- mysql導(dǎo)入數(shù)據(jù)庫文件最大限制的修改方法
- Mysql存儲引擎InnoDB和Myisam的六大區(qū)別
- Mysql運(yùn)行環(huán)境優(yōu)化(Linux系統(tǒng))
- MySQL查詢的性能優(yōu)化基礎(chǔ)教程
- MySQL 在windows上的安裝詳細(xì)介紹
MySQL教程Rss訂閱編程教程搜索
MySQL教程推薦
- 關(guān)于數(shù)據(jù)庫中保留小數(shù)位的問題
- 深入探討:MySQL數(shù)據(jù)庫MyISAM與InnoDB存儲引擎的比較
- MySQL筆記之運(yùn)算符使用詳解
- MySQL自增列插入0值的解決方案
- mysql中text與varchar與char的區(qū)別
- MySQL筆記之?dāng)?shù)據(jù)備份與還原的使用詳解
- MySQL筆記之?dāng)?shù)據(jù)類型詳解
- mysql常用設(shè)置:字符集編碼、自動完成(自動提示)、監(jiān)聽外網(wǎng)ip
- PHP mysqli擴(kuò)展庫 預(yù)處理技術(shù)的使用分析
- 通過frm&ibd 恢復(fù) Mysql ibdata 丟失或損壞的數(shù)據(jù)教程
猜你也喜歡看這些
- 解析SQL Server數(shù)據(jù)庫系統(tǒng)的編譯
- sql server 2005用戶權(quán)限設(shè)置深入分析
- 解讀常規(guī)數(shù)據(jù)庫維護(hù)涉及的5項工作
- Mssql數(shù)據(jù)庫教程之--SQL Server 2008:傳遞表值參數(shù)
- 如何查看并導(dǎo)出數(shù)據(jù)表中字段的注釋信息
- SQL Server 游標(biāo)語句 聲明/打開/循環(huán)實例
- sql server多行數(shù)據(jù)拼接的實例方法
- 查詢表中某字段有重復(fù)記錄個數(shù)的方法
- 解析SqlServer2000獲取當(dāng)前日期及格式
- 怎樣制定自己的SQL Server 2000觸發(fā)器
- 相關(guān)鏈接:
- 教程說明:
MySQL教程-Redis SORT排序命令使用方法詳解(2)
。