当前位置:网站首页>redis常识
redis常识
2022-07-01 11:19:00 【每日一悟】
磁盘:
(1)寻址 ms (2)带宽(单位时间多大数据流过去)ns
内存:
(1)寻址 ns 磁盘比内存在寻址上慢了10w倍
I/O buffer:成本问题
磁盘有磁道和扇区:一扇区512Byte带来索引成本变大
格式化磁盘时有一个4K对齐:读小于4K的,返回4K
无论你从磁盘读多少,都是最少4K
文件里数据,随着文件变大,速度变慢(文件变大,硬盘(i/o)成为瓶颈)
data page (大小4K)
建索引,提升速度
关系型数据库建表,必须给出schema(表的列,每一个列的类型),每一行数据宽度就固定了,更倾向于行级存储。
内存中准备了一个B+树,叶子(data page),树干也在内存中
SQL的where条件里,只要命中索引,查询B+树会走树干,找到叶子,从磁盘读到内存。
(索引放在内存中,会引起内存不够,所以索引和数据都放在磁盘)
数据库的表很大,性能就会变低?
如果表有索引,增删改就会变慢。
查询速度变慢?
(1)1个或少量查询依然很快
(2)并发大的时候会受硬盘带宽影响速度
数据量大,如何快速查询数据库
(磁盘、内存折中)缓存:memcached、redis
计算机系统2个基础设备:冯诺依曼体系的硬件、以太网和TCP/IP的网络
磁盘和内存体积不一样:磁盘中没有指针概念
Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库、缓存和消息中间件。
它支持多种类型的数据结构,如 字符串(strings), 散列(hashes), 列表(lists), 集合(sets), 有序集合(sorted sets) 与范围查询, bitmaps,hyperloglogs 和 地理空间(geospatial) 索引半径查询。
Redis 内置了 复制(replication),LUA脚本(Lua scripting), LRU驱动事件(LRU eviction),事务(transactions) 和不同级别的 磁盘持久化(persistence), 并通过 Redis哨兵(Sentinel)和自动 分区(Cluster)提供高可用性(high availability)。
Redis:
key:
value:String(字符类型、数值类型)、hashes、lists、sets、sorted sets、bitmaps
客户端取回v中的某一个元素,redis的server中对每种类型都有自己的方法(index()、lpop)
memcached(key,value):value没有类型的概念
客户端取回v中的某一个元素,返回value所有的数据到client(通过server 网卡IO),客户端要有你实现的代码去节码
边栏推荐
- When is testing not unit testing- When is a Test not a Unit-test?
- Ultra detailed black apple installation graphic tutorial sent to EFI configuration collection and system
- 十年磨一剑:蚂蚁集团可观测性平台 AntMonitor 揭秘
- 8款最佳实践,保护你的 IaC 安全!
- Applymiddleware principle
- NeurIPS 2022 | 细胞图像分割竞赛正式启动!
- Oracle和JSON的結合
- 为什么一定要从DevOps走向BizDevOps?
- Activity workflow engine
- Flip the array gracefully
猜你喜欢

关于Keil编译程序出现“File has been changed outside the editor,reload?”的解决方法

y48.第三章 Kubernetes从入门到精通 -- Pod的状态和探针(二一)

CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry

【MAUI】为 Label、Image 等控件添加点击事件

我国蜂窝物联网用户已达 15.9 亿,年内有望超越移动电话用户

Face detection and recognition system based on mtcnn+facenet

索引失效的几种情况

2022/6/30学习总结

技术分享 | Linkis参数介绍

Neurips 2022 | cell image segmentation competition officially launched!
随机推荐
[buuctf.reverse] 144_[XMAN2018排位赛]easyvm
Mall applet source code open source version - two open
CVPR 2022 | self enhanced unpaired image defogging based on density and depth decomposition
英特爾實驗室公布集成光子學研究新進展
Combinaison Oracle et json
持续交付-Pipeline入门
树莓派4B安装tensorflow2.0[通俗易懂]
证券账户随便哪里开都能使用吗 开户安全吗
y48.第三章 Kubernetes从入门到精通 -- Pod的状态和探针(二一)
Skip the test cases to be executed in the unittest framework
Xiaomi mobile phone unlocking BL tutorial
获取键代码
Oneconnect plans to be listed in Hong Kong on July 4: a loss of nearly 3 billion in two years, with a market capitalization evaporation of more than 90%
Tempest HDMI leak receive 5
[AI information monthly] 350 + resources! All the information and trends that can't be missed in June are here! < Download attached >
Wonderful! MarkBERT
Applymiddleware principle
openinstall:微信小程序跳转H5配置业务域名教程
Tempest HDMI leak reception 4
谷歌新论文-Minerva:用语言模型解决定量推理问题