- 博客(10)
- 收藏
- 关注
原创 PostgreSQL eighth class
Query 执行过程 query execution plan 根据 sql 的 query 语句,产生执行计划。用最合理的方式完成query 操作。 attribute 数量小 可以 进行 bitmap index 部署db 上进行优化,在不同库存放不同时期数据,当数据海量的情况时。 事务过程 ACID transaction failure: 终止,回滚,恢复 三步 并发控制 postg...
2020-04-30 08:26:55
197
原创 PostgreSQL seventh class
签名索引 除了hash 之外 更好的索引方式 A signature summarises the data from one tuple //Generating a k-in-m codeword for attribute Ai bits codeword(char *attr_value, int m, int k) { int nbits = 0; // count o...
2020-04-29 21:23:16
186
原创 PostgreSQL sixth class
一维索引 primary: index on unique field, may be sorted on A clustering: index on non-unique field, file sorted on A secondary: file not sorted on A dense: every tuple is referenced by an entry in the in...
2020-04-29 13:37:16
246
原创 PostgreSQL fifth class
相比于 hash heap sorted file structure 尽管对page cost 读取进行了优化但是面对大量数据的操作时候还是很耗费时间,所以引入index概念。 Index 存储在index page里面 包含 Id, PageId 大大减少了 page cost,查找所需要读取的page 数目大大减少。 selection 分类:一维 1-d、n维 n-d、 simil...
2020-04-29 08:58:56
259
原创 PostgreSQL fourth class
tuple: 定长 不定长 page 包含 header、record(tuples 以bytes 形式存入)、free space tuple 包含 tuple header(包含 tuple里面每个attribute 的 offset)、columns 几种数据类型: Date Float Integer Number: int[] varchar: char[] 找tuple 里面的 att...
2020-04-28 15:14:47
171
原创 PostgreSQL third class
Storage: Storage manager Storage technology: RAM SSD 老一代存储技术 Cost models: transfer time / read / write time 数据库传输 读写速度是有要求的,太慢是无法接受的 File management: 磁盘空间的管理 etc. 堆比链表快 DB file management organization...
2020-04-27 14:29:29
169
原创 聊聊 Double 和 Float 浮点数
有三种数据类型可以表示浮点数:float、double 和 long double float 为 单精度 4 字节 有效数字 7 double 为双精度 8 字节 有效数字 16 long double 为高双精度 8字节 有效数字 16 1.23456 X 10000 == 12345.6 该数字的第一部分,即 1.23456,称为尾数。 计算机通常使用 E 符号来表示浮点值。以 E 符号表示...
2020-04-13 09:48:35
1053
1
原创 linux 从入门到精通(第二版)读书笔记
第二章 虚拟机的使用 虚拟机是这样一种软件:它本身安装在一个操作系统中,却可以虚拟出整个硬件环境。在这个虚拟出来的硬件环境中,可以安装另一个操作系统。对于这两个操作系统,前者被称为宿主操作系统,后者被称为客户操作系统。使用虚拟机最显而易见的优点在于,对客户操作系统的任何操作都不会对实际的硬件系统产生不良影响,因为其所依赖的硬件环境都是虚拟出来的。最终反映在硬盘上的,只是一系列文件。 硬盘分...
2020-04-08 10:26:07
264
原创 聊聊Fibonacci
def Fibonacci(n): if n <= 0: return 0 if n == 1: return 1 return Fibonacci(n-1) + Fibonacci(n) 存在问题:计算过程中很多节点是重复的,而且重复的节点数会随着n的增大而急剧增加,时间复杂度是以n的指数的方式递增的。 改进: 最简单的方法是从头往后去计算: def Fibonacci(n...
2020-04-08 08:33:52
128
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅