口碑好的微信网站建设,代运营竞价公司,博客可以做seo吗,网站导航条背景图片client连接PostgreSQL过程#xff1a; 1、客户端发起请求 2、主服务postmaster进程负责服务器是否接受客户端的host通信认证#xff0c;服务器对客户端进行身份鉴别 3、主服务进程为该客户端单独fork一个客户端工作进程postgres 4、客户端与postgres进程建立通信连接#xf…
client连接PostgreSQL过程 1、客户端发起请求 2、主服务postmaster进程负责服务器是否接受客户端的host通信认证服务器对客户端进行身份鉴别 3、主服务进程为该客户端单独fork一个客户端工作进程postgres 4、客户端与postgres进程建立通信连接由postgres进程负责后续所有的客户端请求操作直至客户端退出后
进程 Postmaster进程是PG数据库的总控制进程负责启动和关闭数据库实例是第一个postgres进程。Postmaster的主进程还会fork出一些辅助子进程。
BgWriter后台写进程 WaLWriter预写式日志进程 AutoVAcuum系统自动清理 SysLogger系统日志进程 PgArch归档进程 PgStat统计数据收集进程 CheckPoint检查点进程
内存
共享内存区 shared_buffers —共享缓冲区它表示数据缓冲区中的数据块的个数每个数据块的大小是8KB。推荐值1/4 主机物理内存
wal_buffers — 日志缓存区的大小 存放WAL数据的内存空间大小系统默认值是64K
私有内存区
temp_buffers—临时缓冲区 用于存放数据库会话访问临时表数据系统默认值为8M。 work_mem — 工作内存或者操作内存。其负责内部的sort和hash操作合适的work_mem大小能够保证这些操作在内存中进行。 maintenance_work_mem —维护工作内存 主要是针对数据库的维护操作主要针对VACUUMCREATE INDEXALTER TABLE ADD FOREIGN KEY等操作。
PGDATA主要目录 drwx------ 6 postgres postgres 54 Mar 29 16:37 base drwx------ 2 postgres postgres 4096 Mar 30 20:50 global drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_commit_ts drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_dynshmem -rw------- 1 postgres postgres 4760 Mar 26 11:26 pg_hba.conf -rw------- 1 postgres postgres 1636 Mar 26 11:26 pg_ident.conf drwx------ 4 postgres postgres 68 Mar 31 16:13 pg_logical drwx------ 4 postgres postgres 36 Mar 26 11:26 pg_multixact drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_notify drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_replslot drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_serial drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_snapshots drwx------ 2 postgres postgres 6 Mar 29 14:29 pg_stat drwx------ 2 postgres postgres 105 Apr 1 09:17 pg_stat_tmp drwx------ 2 postgres postgres 18 Mar 26 11:26 pg_subtrans drwx------ 2 postgres postgres 19 Mar 30 20:41 pg_tblspc drwx------ 2 postgres postgres 6 Mar 26 11:26 pg_twophase -rw------- 1 postgres postgres 3 Mar 26 11:26 PG_VERSION drwx------ 3 postgres postgres 60 Mar 26 11:26 pg_wal drwx------ 2 postgres postgres 18 Mar 26 11:26 pg_xact -rw------- 1 postgres postgres 88 Mar 26 11:26 postgresql.auto.conf -rw------- 1 postgres postgres 28011 Mar 26 11:26 postgresql.conf -rw------- 1 postgres postgres 33 Mar 29 14:29 postmaster.opts -rw------- 1 postgres postgres 91 Mar 29 14:29 postmaster.pid
ll base/ drwx------ 2 postgres postgres 8192 Mar 29 16:36 12723 drwx------ 2 postgres postgres 8192 Mar 29 16:37 16393
base用于存放当前实例下所有的数据库数字化命名的路径表示各个数据库每个数字表示数据库的oid
oid2name 展示数据库对应的表空间信息 All databases: Oid Database Name Tablespace
12723 postgres pg_default 16393 testdb pg_default
pg_commit_ts事务提交时间戳信息commit timestamp; pg_dynshmem共享内存使用的文件信息dynamic shared memory; pg_hba.conf关于客户端如何访问数据库的配置文件 host based authentication; pg_logical:数据库逻辑解码的状态数据 pg_multixact存放多事务状态数据共享锁信息multi transaction; pg_notify:数据库配置订阅模式的LISTEN/NOTIFY状态数据 pg_replslot数据库复制槽信息replication slot; pg_serial已提交的串行化事务信息serializable; pg_snapshots:导出的快照信息内置pg_export_snapshot()函数导出 pg_stat统计子系统收集的统计信息statistics pg_stat_tmp统计子系统收集的临时统计信息statistics temporary; pg_subtrans子事务的转态数据sub-transactions; pg_tblspc表空间的映射 pg_twophase两阶段提交事务的状态信息 PG_VERSION存放数据库版本信息 pg_wal存放数据库的日志文件类似于Oracle的redo log。write ahead log; pg_xact事务提交状态数据用于控制事务的Multi Version Concurrent ContrilPostgreSQL事务有4种状态:IN_PROGRESS,COMMITED,ABORTED,SUB_COMMITTED postgresql.auto.conf存放通过alter sytem命令修改的参数 postgresql.conf数据库配置的参数文件类似于Oracle的参数文件spfile postmaster.opts记录数据库启动时的选项options; postmaster.pid 主进程文件
逻辑结构 DataBase tablespace Schema object
创建一个Database时这个Database会创建一个名为public的默认Schema每个Database可以有多个Schema在这个数据库中创建其他数据库对象时如果没有指定Schema都会在public这个Schema中Schema可以理解为一个数据库中的命名空间在数据库中创建的所有对象都Schema中创建一个用户可以从同一个客户端连接中访问不同的Schema不同的Schema中可以有多个相同的名称的Table、Index、View、Sequence、Function等数据库对象。