Postgresql数据库体系结构-存储结构

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
简介: PostgreSQL数据库体系结构-存储结构 存储结构 聚簇逻辑结构聚簇物理结构 聚簇数据库数据文件表空间数据文件内部结构tuple的读写方法 1、数据库聚簇逻辑结构(Logical Structure of Database Cluster) database...

PostgreSQL数据库体系结构-存储结构

存储结构

聚簇逻辑结构

聚簇物理结构

聚簇

数据库

数据文件

表空间

数据文件内部结构

tuple的读写方法

1、数据库聚簇逻辑结构(Logical Structure of Database Cluster)

  • database cluster--数据库聚簇,是一组数据库的集合,而不是多个数据库服务器
  • database--数据库,是一组数据库对象的集合
  • database object--数据库对象,是一种数据结构,用于存储查询数据

    database cluster > database > database object 包含与被包含的关系。
  • object identifiers (OIDs)--对象标识,OIDs存储在system catalog。不同对象类型的OID存储在不同的catalog中。database的OID存储在pg_database中;table的OID存储在pg_class中
  • Database cluster,Database,Users,Schemas,Tablespace,Table
    总体上来说,这些逻辑对象是使用与被使用的关系,不是隶属关系
postgres=# select oid,datname,dattablespace from pg_database;
oid | datname | dattablespace 
-------+-----------+---------------
13212 | postgres | 1663
1 | template1 | 1663
13211 | template0 | 1663
(3 rows)
postgres=# select oid,relname,relowner from pg_class where relname='test_rep';
oid | relname | relowner 
-------+----------+----------
57362 | test_rep | 49156
(1 row)
注1:system catalog相关描述参考文档
<https://www.postgresql.org/docs/11/bki.html>
注2:OID是伪列

2、数据库聚簇物理结构(Physical Structure of Database Cluster)

database cluster物理上是一个 base directory(PGDATA),包括一些子目录和文件

[pg@pg data]$ tree -L 2
.
├── backup_label.old
├── base
│   ├── 1
│   ├── 13211
│   └── 13212
├── current_logfiles
├── global
│   ├── 1136
│   ├── 1136_fsm
│   ├── 1136_vm
│   ├── pg_control
│   ├── pg_filenode.map
│   └── pg_internal.init
├── pg_commit_ts
├── pg_dynshmem
├── pg_hba.conf
├── pg_ident.conf
├── pg_log
├── pg_logical
│   ├── mappings
│   ├── replorigin_checkpoint
│   └── snapshots
├── pg_multixact
│   ├── members
│   └── offsets
├── pg_notify
│   └── 0000
├── pg_replslot
├── pg_serial
├── pg_snapshots
├── pg_stat
├── pg_stat_tmp
│   ├── db_0.stat
│   ├── db_13212.stat
│   └── global.stat
├── pg_subtrans
│   └── 0000
├── pg_tblspc
│   ├── 16388 -> /opt/postgres/data/tb1
│   └── 49155 -> /tbs
├── pg_twophase
├── PG_VERSION
├── pg_wal
│   ├── 000000090000000000000077
│   └── archive_status
├── pg_xact
│   └── 0000
├── postgresql.auto.conf
├── postgresql.auto.conf.bak20181230
├── postgresql.conf
├── postmaster.opts
├── postmaster.pid
├── recovery.done
├── serverlog
├── tablespace_map.old
└── tb1

2.1、数据库聚簇布局结构(Layout of a Database Cluster)

  • base--存放数据库的子目录
  • global--包括聚簇范围的表,如pg_database

pg_control--控制文件,用于存储全局控制信息

pg_filenode.map--系统表的OID与具体文件名进行硬编映射

pg_internal.init--缓存系统文件,加快系统表读取速度

  • 1136--对象数据文件,每个表和索引都存储为单独的文件,以表或索引的filenode number命令(pg_class.relfilenode)
  • 1136_fsm--数据文件对应的FSM(free space map)件,用map方式来标识哪些block是空闲的
  • 1136_vm--数据文件对应的VM(visibility map)PostgreSQL中在做多版本并发控制时是通过在元组头上标“已无效”来实现删除或更新的,最后通过VACUUM功能来清理效数据回收空闲空间。在做VACUUM时就使用VM快速查找包含无效元组的block。VM仅是个简单的bitmap,一个bit对应一block。
  • pg_hba.conf--客户端网络访问控制配置文件
  • pg_log--默认错误日志输出位置
  • pg_logical--配置逻辑复制时,存储逻辑解码的数据状态
  • pg_tblspc--存放非默认表空间路径,软连接的形式
  • pg_wal--wal日志路径
  • postgresql.auto.conf--参数文件,使用alter system命令修改的参数文件,优先级高,会覆盖postgresql.conf参数值
  • postgresql.conf--参数配置文件
  • postmaster.opts--记录上次启动服务器时使用的命令行选项的文件
  • postmaster.pid--启动pg后产生的文件,记录启动pg的信息
  • tb1--非默认表空间

    详细描述参考官方文档

https://www.postgresql.org/docs/current/storage-file-layout.html

提示:
查看控制文件记录
[pg@pg global]$ pg_controldata 
pg_control version number: 1002
Catalog version number: 201707211
Database system identifier: 6577238410286647636
Database cluster state: in production
pg_control last modified: Wed 16 Jan 2019 01:52:26 PM CST
Latest checkpoint location: 0/77271BC0
Prior checkpoint location: 0/77271B18
Latest checkpoint's REDO location: 0/77271BC0
Latest checkpoint's REDO WAL file: 000000090000000000000077
Latest checkpoint's TimeLineID: 9
Latest checkpoint's PrevTimeLineID: 9
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0:681
Latest checkpoint's NextOID: 81960
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 548
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint: Wed 16 Jan 2019 01:52:26 PM CST
Fake LSN counter for unlogged rels: 0/1
Minimum recovery ending location: 0/0
Min recovery ending locs timeline: 0
Backup start location: 0/0
Backup end location: 0/0
End-of-backup record required: no
wal_level setting: replica
wal_log_hints setting: on
max_connections setting: 100
max_worker_processes setting: 8
max_prepared_xacts setting: 0
max_locks_per_xact setting: 64
track_commit_timestamp setting: off
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 131072
WAL block size: 8192
Bytes per WAL segment: 16777216
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Size of a large-object chunk: 2048
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
Data page checksum version: 0
Mock authentication nonce: d689960231e71d87b4ea9a8324398a84ce89709786d3c2cb1a18bbede989b1db
[pg@pg global]$ 
查看pg_filenode.map记录
[pg@pg global]$ hexdump pg_filenode.map 
0000000 2717 0059 0023 0000 04ee 0000 04ee 0000
0000010 0b94 0000 0b94 0000 04bd 0000 04bd 0000
0000020 0470 0000 0470 0000 04ec 0000 04ec 0000
0000030 04ed 0000 04ed 0000 04be 0000 04be 0000
0000040 095c 0000 095c 0000 1770 0000 1770 0000
0000050 0e08 0000 0e08 0000 17d4 0000 17d4 0000
0000060 0b1e 0000 0b1e 0000 0b1f 0000 0b1f 0000
0000070 0b96 0000 0b96 0000 0b97 0000 0b97 0000
0000080 0fdc 0000 0fdc 0000 0fdd 0000 0fdd 0000
0000090 0a74 0000 0a74 0000 0a75 0000 0a75 0000
00000a0 0a86 0000 0a86 0000 0a87 0000 0a87 0000
00000b0 0a6f 0000 0a6f 0000 0a70 0000 0a70 0000
00000c0 095d 0000 095d 0000 0471 0000 0471 0000
00000d0 04d0 0000 04d0 0000 04d1 0000 04d1 0000
00000e0 0a89 0000 0a89 0000 0a8a 0000 0a8a 0000
00000f0 0b95 0000 0b95 0000 0e09 0000 0e09 0000
0000100 1771 0000 1771 0000 1772 0000 1772 0000
0000110 17e2 0000 17e2 0000 17e3 0000 17e3 0000
0000120 0000 0000 0000 0000 0000 0000 0000 0000
*
00001f0 0000 0000 0000 0000 9ee5 3d9a 0000 0000
0000200
[pg@pg global]$ 

2.2、数据库布局结构(Layout of Databases)

数据库存放在base目录下,数据库目录名以OIDs命名
[pg@pg data]$ tree -L 1 base
base
├── 1
├── 13211
└── 13212

2.3、数据文件布局结构

单个文件大小小于1G的表或索引,存储在所属数据库目录下,每个表或索引都有自己的OID。

数据库内部,管理表和索引通过OID

数据库外部,管理数据文件(表和索引对应的)通过可变的relfilenode

查看pg_class获取relfilenode和oid信息
postgres=# select relname,relfilenode,oid,relnamespace from pg_class where relname='test_table';
relname | relfilenode | oid | relnamespace 
------------+-------------+-------+--------------
test_table | 81961 | 81961 | 81960
(1 row)
注意1:
relfilenode可变,并不总是与OID相匹配,如truncate命令会改变relfilenode
postgres=> truncate table test_table;
postgres=> select relname,relfilenode,oid,relnamespace from pg_class where relname='test_table';
relname | relfilenode | oid | relnamespace 
------------+-------------+-------+--------------
test_table | 81967 | 81961 | 81960
(1 row)
通过pg_class可找到oid对应的object name
postgres=# select oid,relname from pg_class where oid in ( 2610,1255);
oid | relname 
------+----------
1255 | pg_proc
2610 | pg_index
(2 rows)
通过内置函数pg_relation_filepath(relation regclass)可以找到对应的物理文件
postgres=> SELECT pg_relation_filepath('test_table');
pg_relation_filepath 
----------------------
base/13212/81967
(1 row)

查看物理文件
通过内置函数pg_relation_filepath(relation regclass)可以找到对应的物理文件
postgres=> SELECT pg_relation_filepath('test_table');
pg_relation_filepath 
----------------------
base/13212/81967
(1 row)

[pg@pg ~]$ ls -atl $PGDATA/base/13212/81967
-rw------- 1 pg pg 0 Jan 24 14:01 /opt/postgres/data/base/13212/81967
  • 当一个表或索引超过 1 GB 时, 它被划分为G大小的段,文件命名为relfilenode、relfilenode.1、relfilenode.2......

    注意:The maximum file size of tables and indexes can be changed using the configuration, option --with-segsize when building PostgreSQL.
  • 每个数据文件都有两个相关后缀文件,'_fsm' and '_vm',分别对应free space map and visibility map,索引的数据文件只有'_fsm'。
  • Unlogged tables and indexes have a third fork, known as the initialization fork, which is stored in a fork with the suffix _init
eg:
postgres=#  create unlogged table test_unlog(a int);
CREATE TABLE
postgres=# insert into test_unlog select generate_series(1,1000);
INSERT 0 1000
postgres=# SELECT pg_relation_filepath('test_unlog');
 pg_relation_filepath 
----------------------
 base/13212/102776
(1 row)
[pg@pg 13212]$  ls -atl 102776*
-rw------- 1 pg pg 40960 Mar 20 17:35 102776
-rw------- 1 pg pg 24576 Mar 20 17:35 102776_fsm
-rw------- 1 pg pg     0 Mar 20 17:35 102776_init

物理文件空间大小
pg_total_relation_size(regclass)
bigint
Total disk space used by the specified table, including all indexes and TOAST data
pg_table_size(regclass)
bigint
Disk space used by the specified table, excluding indexes (but including TOAST, free space map, and visibility map)
pg_indexes_size(regclass)
bigint
Total disk space used by indexes attached to the specified table
pg_relation_size(relation regclass, fork text)
bigint
Disk space used by the specified fork ('main', 'fsm', 'vm', or 'init') of the specified table or index

postgres=> select pg_size_pretty(pg_table_size('test_toast'));
pg_size_pretty 
----------------
4016 kB
(1 row)

2.4、表空间

tablespace--独立于base目录,是一个额外的数据存储区data area

如下两个存储区表示

**cluster>'base'>database>object

cluster>'tablespace'>[database]>object**

表空间路径在CREATE TABLESPACE 时,其目录下会自动创建子目录,格式如下
PG_'Major version'_'Catalogue version number'
如:
[pg@pg /]$ tree -L 1 /tbs
/tbs
└── PG_10_201707211
表空间的类型有,默认表空间pg_default,系统共享表空间pg_global,自定义表空间
postgres=# select oid,spcname,pg_tablespace_location(oid) from pg_tablespace;
oid | spcname | pg_tablespace_location 
-------+------------+------------------------
1663 | pg_default | 
1664 | pg_global | 
16388 | tb1 | /opt/postgres/data/tb1
49155 | pitrtbs | /tbs
(4 rows)
所有的自定义表空间目录,都会在$PGDATA/pg_tblspc中创建符号链接,链接名与该表空间的OID相同
select oid,spcname,spcowner,spcoptions from pg_tablespace;
如:
[pg@pg /]$ tree -L 1 $PGDATA/pg_tblspc
/opt/postgres/data/pg_tblspc
├── 16388 -> /opt/postgres/data/tb1
└── 49155 -> /tbs
如果创建的表属于base下的数据库,会在表空间下创建一个与已存在数据库oid相同名字的一个目录,然后将数据文件放在此目录下
如:
[pg@pg /]$ tree -L 3 /tbs
/tbs
└── PG_10_201707211
└── 13212
├── 49163
├── 49166
└── 49168

2.5、oid2name

oid2name — resolve OIDs and file nodes in a PostgreSQL data directory

[pg@pg base]$ oid2name 
All databases:
Oid Database Name Tablespace
----------------------------------
13212 postgres pg_default
13211 template0 pg_default
1 template1 pg_default
[pg@pg base]$ oid2name -s
All tablespaces:
Oid Tablespace Name
------------------------
1663 pg_default
1664 pg_global
16388 tb1
49155 pitrtbs
[pg@pg 13212]$ pwd
/opt/postgres/data/base/13212
[pg@pg 13212]$ ls -atl |head -5
total 14772
drwx------ 2 pg pg 8192 Feb 27 09:51 .
-rw------- 1 pg pg 136164 Feb 27 09:51 pg_internal.init
-rw------- 1 pg pg 32768 Feb 26 09:00 2610
-rw------- 1 pg pg 606208 Feb 23 11:23 1255
[pg@pg 13212]$ 
[pg@pg 13212]$ oid2name -d postgres -f 2610 -f 1255
From database "postgres":
Filenode Table Name
----------------------
2610 pg_index
1255 pg_proc
[pg@pg 13212]$ 

3、数据文件内部结构

  • page--数据库中最小的存储单元。在数据文件(堆表、索引、free space map and visibility map)内部,空间被分配成固定长度的pages使用,默认大小8192 byte (8 KB)
  • block numbers--每个page都是从0开始按顺序编号使用(编号叫block numbers),如果page已被填满,PostgreSQL会在文件末尾添加一个新的空页,以增加文件大小。
block 0
|—————————————————————————————————————————|
|header_data(24byte)|pg_lsn|xxx|----------|
|—————————————————————————————————————————|
|pg_lower|pg_upper|line_pointer_1(4byte)--|
|—————————————————|———————————————————————|
|line_pointer_2|xxx|----------------------|
|—————————————————————————————————————————|
|--------------freespace------------------|
|-----------------freespace---------------|
|—————————————————————————————————————————|
|-----------|xxx|heap_tuple_2|heap_tuple_1|
|—————————————————————————————————————————|

page结构包括3部分

  • header data--在page头部,24个字节长度,记录page的元数据信息

pd_lsn--存储page最新更改时,wal日志的lsn信息

pd_checksum--存储page的校验值

pd_lower, pd_upper--pd_lower指向line pointer尾部;pd_upper指向最新heap tuple的头部

pd_special--主要用于索引,在表中,指向最后一个page
line pointer(s)--在header data之后。行指针的长度为4个字节,用于保存指向每个heap tuple的指针,是heap tuple的索引。每存放一个tuple就会有一个line pointer

  • heap tuple(s)--用来存放数据,从page底部开始使用(行数据)

tuple identifier (TID)--为了在表中标识元组,在内部使用了元组标识符(tid)。tid包含一对值,包含tuple的page的block numbers,以及指向该tuple的line pointer的偏移编号。这是一个典型的索引用法,用来查找tuple数据。此外,heap tuple总大小超过2KB(约1/4 8KB),使用一种TOAST (The Oversized-Attribute Storage Technique)的方式进行管理

  • 以上可知,line pointer的末尾到最新heap tuple的头部,这中间的部分叫 free space

4、tuple的读写方法

数据库是如何进行读写操作的呢?下文给出一个简单的描述,后期结合相关内容会有更详细的描述

假设一个表只包含一个page,一个page只包括一个heap tuple

4.1、写(write)

结构如下

block 24
|—————————————————————————————————————————|
|header_data(24byte)|pg_lsn|xxx|----------|
|—————————————————————————————————————————|
|pg_lower|pg_upper|line_pointer_1(4byte)--|
|—————————————————————————————————————————|
|---------------freespace-----------------|
|---------------freespace-----------------|
|—————————————————————————————————————————|
|----------------------------|heap_tuple_1|
|—————————————————————————————————————————|
如图所示,分配一个序号为block 24的page(8192字节),当前情况下
page的前24字节存储header data
之后的4字节存储line pointer 1
中间空间为free space
page末尾存放第一个heap tuple 1
此时
line pointer 1指向heap tuple 1
pg_lower指向line pointer 1
pg_upper指向heap tuple 1

现在插入一行数据,结构如下

block 24
|—————————————————————————————————————————|
|header_data(24byte)|pg_lsn|xxx|----------|
|—————————————————————————————————————————|
|pg_lower|pg_upper|line_pointer_1(4byte)--|
|—————————————————————————————————————————|
|line_pointer_2|--------------------------|
|—————————————————————————————————————————|
|------------freespace--------------------|
|--------------freespace------------------|
|—————————————————————————————————————————|
|---------------|heap_tuple_2|heap_tuple_1|
|—————————————————————————————————————————|
情况如下
在line pointer 1之后分配新4字节存放line pointer 2
在heap tuple 1之前存放最新的heap tuple 2
此时
line pointer 1指向heap tuple 1
line pointer 2指向heap tuple 2
pg_lower指向line pointer 2
pg_upper指向heap tuple 2

4.2、读(read):分为两种,顺序读和索引读*

1顺序读(Sequential scan)

2索引读(B-tree index scan) --TID value of the obtained index tuple is '(block = 24, Offset = 2)'

4.2.1、顺序读:Sequential scan

结构如下

select * from test_table;
block 24
|—————————————————————————————————————————|
|header data(24byte)|pg_lsn|xxx|----------|
|—————————————————————————————————————————|
|pg_lower|pg_upper|line_pointer_1(4byte)--|
|—————————————————————————————————————————|
|line_pointer_2|--------------------------|
|—————————————————————————————————————————|
|------------freespace------ -------------|
|------------freespace--------------------|
|—————————————————————————————————————————|
|---------------|heap_tuple_2|heap_tuple_1|
|—————————————————————————————————————————|
此时
扫描block 1 的page,扫描line pointer 1...line pointer n
扫描block 2 的page,扫描line pointer 1...line pointer n
......
扫描block 24 的page,扫描line pointer 1找到需要的数据heap tuple1

4.2.2、索引读:B-tree index scan

机构如下

select * from test_table where id=244;
block 24
|—————————————————————————————————————————|
|header data(24byte)|pg_lsn|xxx|----------|
|———————————————————————————————————————— |
|pg_lower|pg_upper|line_pointer_1(4byte)--|
|—————————————————————————————————————————|
|line_pointer_2|--------------------------|
|—————————————————————————————————————————|
|--------------freespace------------------|
|--------------freespace------------------|
|—————————————————————————————————————————|
|---------------|heap_tuple_2|heap_tuple_1|
|—————————————————————————————————————————|
此时
直接通过索引tuple记录'(block = 24, Offset = 2)',找到block 24的page,读取line pointer 2,找到需要的heap tuple 2
相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
22天前
|
关系型数据库 分布式数据库 数据库
成都晨云信息技术完成阿里云PolarDB数据库产品生态集成认证
近日,成都晨云信息技术有限责任公司(以下简称晨云信息)与阿里云PolarDB PostgreSQL版数据库产品展开产品集成认证。测试结果表明,晨云信息旗下晨云-站群管理系统(V1.0)与阿里云以下产品:开源云原生数据库PolarDB PostgreSQL版(V11),完全满足产品兼容认证要求,兼容性良好,系统运行稳定。
|
29天前
|
关系型数据库 分布式数据库 数据库
PolarDB常见问题之数据库不能自己减少节点如何解决
PolarDB是阿里云推出的下一代关系型数据库,具有高性能、高可用性和弹性伸缩能力,适用于大规模数据处理场景。本汇总囊括了PolarDB使用中用户可能遭遇的一系列常见问题及解答,旨在为数据库管理员和开发者提供全面的问题指导,确保数据库平稳运行和优化使用体验。
|
29天前
|
缓存 关系型数据库 分布式数据库
PolarDB常见问题之数据库cpu突然飙高如何解决
PolarDB是阿里云推出的下一代关系型数据库,具有高性能、高可用性和弹性伸缩能力,适用于大规模数据处理场景。本汇总囊括了PolarDB使用中用户可能遭遇的一系列常见问题及解答,旨在为数据库管理员和开发者提供全面的问题指导,确保数据库平稳运行和优化使用体验。
|
7天前
|
运维 关系型数据库 分布式数据库
「合肥 * 讯飞」4 月 19 日 PolarDB 开源数据库沙龙,报名中!
4月19日周五,PolarDB开源社区联合科大讯飞共同举办开源数据库技术沙龙,本次沙龙我们邀请了众多数据库领域的专家,期待大家的参与!
「合肥 * 讯飞」4 月 19 日 PolarDB 开源数据库沙龙,报名中!
|
8天前
|
存储 SQL Oracle
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
32 7
|
16天前
|
数据库 存储 BI
SAP ABAP CDS View 源代码存储的数据库表揭秘和其他相关数据库表介绍试读版
SAP ABAP CDS View 源代码存储的数据库表揭秘和其他相关数据库表介绍试读版
10 0
SAP ABAP CDS View 源代码存储的数据库表揭秘和其他相关数据库表介绍试读版
|
25天前
|
存储 SQL 数据库
C# 将 Word 转文本存储到数据库并进行管理
C# 将 Word 转文本存储到数据库并进行管理
|
29天前
|
存储 关系型数据库 分布式数据库
PolarDB常见问题之PolarDB突然有大量服务连不上数据库如何解决
PolarDB是阿里云推出的下一代关系型数据库,具有高性能、高可用性和弹性伸缩能力,适用于大规模数据处理场景。本汇总囊括了PolarDB使用中用户可能遭遇的一系列常见问题及解答,旨在为数据库管理员和开发者提供全面的问题指导,确保数据库平稳运行和优化使用体验。
|
1月前
|
存储 关系型数据库 MySQL
TiDB与MySQL、PostgreSQL等数据库的比较分析
【2月更文挑战第25天】本文将对TiDB、MySQL和PostgreSQL等数据库进行详细的比较分析,探讨它们各自的优势和劣势。TiDB作为一款分布式关系型数据库,在扩展性、并发性能等方面表现突出;MySQL以其易用性和成熟性受到广泛应用;PostgreSQL则在数据完整性、扩展性等方面具有优势。通过对比这些数据库的特点和适用场景,帮助企业更好地选择适合自己业务需求的数据库系统。
|
16天前
|
SQL 数据可视化 关系型数据库
轻松入门MySQL:深入探究MySQL的ER模型,数据库设计的利器与挑战(22)
轻松入门MySQL:深入探究MySQL的ER模型,数据库设计的利器与挑战(22)