当前位置:网站首页>What is the maximum length that can be set for the bitmap of redis? Why is the maximum length bit that can be set 2 ^ 32? How to calculate how much space the bitmap will occupy
What is the maximum length that can be set for the bitmap of redis? Why is the maximum length bit that can be set 2 ^ 32? How to calculate how much space the bitmap will occupy
2022-04-22 04:49:00 【Day____ Day____ Up】
Premise : actually , redis Only support 5 Type of data . did not bitmap. That is to say bitmap Is based on redis Of string type . A string type can store up to 512M.
First : First understand the unit conversion of computer
8 bit = 1byte
1024 byte = 1kb
1024 kb = 1Mb
secondly :
What we use bitmap Instructions SETBIT key offset value, This instruction is to put the offset Set to 0 or 1. such as SETBIT ss 1000 1 // Will be 1000 The position is 1. 1 bit Namely 1 position , So we just need to 512M The conversion bit, Then I know bitmap The maximum set length supported . The calculation is as follows
8 * 1024 * 1024 * 512 = 2^32 ( So that's the result )
How to calculate your own bitmap How much storage space will it take ?
Take a chestnut : There is one today bitmap Maximum length 1024, How much space does it take ?
Explain : length 1024 That is, he needs 1024 bits (bit), Or the unit is byte Just need 1024 / 8, That is to say 128byte
版权声明
本文为[Day____ Day____ Up]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210758106041.html
边栏推荐
- 仿真生成随机数计算生成每个同学生日
- 10.libevent接收和处理服务器消息
- I'll test the timing again
- How to realize different values and display different colors in MATLAB
- How can devices of different brands be compatible and interconnected? Yiwen teaches you to understand
- Morphological operation of OpenCV image processing
- LeetCode 剑指 Offer 18. 删除链表的节点
- Win10 Caton repair
- The role and risk of setsql using lamdbaupdatewrapper
- 6. Comparable to JMeter Net pressure measurement tool - crank practical chapter - collecting diagnosis tracking information and how to analyze bottlenecks
猜你喜欢

Logistic regression -- case: cancer classification and prediction

Sharing of enterprise data leakage prevention scheme

Several key points of logistic regression

EMO-DB 数据集的 Speech 特征提取

kaggle實戰4.1--時間序列預測問題

Discussion on data set division

rsync概述

Deployment of web server, personal experience

Carina 本地存储入选 CNCF 云原生全景图

Boyun beyondcmp cloud management platform version 5.6 release
随机推荐
Apple plans to expand children's information and communication security features to the UK and Canada
2021-08-14
Iris species prediction -- Introduction to data set
Linked list Part III
Transaction isolation level and mvcc
Combined sum leetcode
C-handwritten 10
2021-08-14
LeetCode 剑指 Offer 22. 链表中倒数第k个节点
Common commands of labelme
10.libevent接收和处理服务器消息
Sharing of enterprise data leakage prevention scheme
labelme的常用命令
Setting method of parameters such as color and linetype of MATLAB curve
Kaggle actual combat 4.1 -- time series prediction problem
Overview of over fitting and under fitting treatment methods of linear regression
Sort one
2021-08-14
Inotify Brief
12. Libevent loop function and exit test