PostgreSQL 开发最佳实践• 命名规约 • 设计规约 • 管理规约 • 稳定性与性能建议 • 云数据库使用建议 2016Postgres中国用户大会 规约的重要性 2016Postgres中国用户大会 目录 • 规约的重要性 • 命名规约 • 设计规约 • 管理规约 • 稳定性与性能建议 • 云数据库使用建议 2016Postgres中国用户大会 命名规约 • quote_nullable xxx where xxx; comment on table is "????"; 使用有意义的对象名; 使用小写字母,下划线,数字; 2016Postgres中国用户大会 目录 • 规约的重要性 • 命名规约 • 设计规约 • 管理规约 • 稳定性与性能建议 • 云数据库使用建议 2016Postgres中国用户大会 设计规约 • 返回多行 • select 问题(备份、恢复、创建索引、索引深度),分区 2016Postgres中国用户大会 目录 • 规约的重要性 • 命名规约 • 设计规约 • 管理规约 • 稳定性与性能建议 • 云数据库使用建议 2016Postgres中国用户大会 管理规约 • begin; set local lock_timeout = '10s'; -- DDL query; end; • begin;0 码力 | 16 页 | 381.36 KB | 1 年前3
postgresql操作手册蓝色字体表示命令行命令,正式执行时不要复制前面的#号,#号只是提示应 该使用root权限操作 2.绿色字体表示注释,有时注释太多就不用绿色表示了 3.注意:本文档的所有操作请先在测试机里进行实践,请不要直接在真实的服 务器中操作! 版权声明: 本文档以开源的形式发布,所有条款如下: (1)无担保:作者不保证文档内容的准确无误,亦不承担由于使用此文档所导致的任何后果 (2)自由使用:任何人可以出于任何目的而自由地 postgresql 如果想安装其他版本,可到官网查询安装方法 h�ps://www.postgresql.org/download/linux/redhat/ 本文档选择PG-13版本作为讲解,使用el8系列的系统,x86_64平台 # yum install -y h�ps://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat- #退出PG交互界面 # psql -h localhost -p 5432 -U postgres #使用postgres用户登录,需要密 码,默认登录postgres库 postgres=# #提示符 => 表示普通账号,=#表示管理员账号0 码力 | 17 页 | 445.84 KB | 1 年前3
PostgreSQL 9.5.25 Documentation
three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance may be helpful to encourage the use of index scans by reducing random_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction rollbacks and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2558 页 | 6.27 MB | 1 年前3
PostgreSQL 9.5 Documentationthree types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance may be helpful to encourage the use of index scans by reducing ran- dom_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction roll- backs and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2714 页 | 6.33 MB | 1 年前3
实现PostgreSQL逻辑复制实战2016Postgres中国用户大会 Postgres Conference China 2016 中国用户大会 逻辑复制特点 它兼顾有基于触发器复制技术的灵活性 同时又有基于日志复制技术的高效性 它使用发布/订阅模型对选择性的数据 复制相对物理复制来说是非常方便 2016Postgres中国用户大会 Postgres Conference China 2016 中国用户大会 特性 逻 这些流可以根据需要更改成用户需要的状态 用户可以根据需要的状态 进行需要的操作 2016Postgres中国用户大会 Postgres Conference China 2016 中国用户大会 是否能保证备库使用WAL段之前不会 过早的移除它们 主库不会过早的清除掉掉从库正在使 用的记录 是否可以控制日志大小 复制槽技术 可以保证 可以保证 可能会造成膨胀 非复制槽 的场景定义不同的输出规则。也可以在相同的场景定 义不同的规则 2016Postgres中国用户大会 Postgres Conference China 2016 中国用户大会 自动导出快照 当使用流复制接口创建一个新的复制槽时, 将会自动产生一个快照。 无DB限制 Pg的逻辑复制可以根据需求把WAL日志直接翻译成 可以直接解析的SQL语句,并通过槽技术向不同DB 进行传递,从而实现不同DB数据库的复制。0 码力 | 17 页 | 1.90 MB | 1 年前3
PostgreSQL 9.4 Documentationthree types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance may be helpful to encourage the use of index scans by reducing ran- dom_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction roll- backs and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2603 页 | 6.05 MB | 1 年前3
PostgreSQL 9.4.26 Documentation
three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when 116 Chapter 8. Data Types storing into a length-constrained column may be helpful to encourage the use of index scans by reducing random_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction rollbacks and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2452 页 | 5.99 MB | 1 年前3
PostgreSQL 9.6.24 Documentationthree types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance may be helpful to encourage the use of index scans by reducing ran- dom_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction roll- backs and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2814 页 | 6.58 MB | 1 年前3
PostgreSQL 9.6.24 Documentation
three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance may be helpful to encourage the use of index scans by reducing random_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction rollbacks and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2661 页 | 6.53 MB | 1 年前3
PostgreSQL 10.23 Documentationthree types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance may be helpful to encourage the use of index scans by reducing ran- dom_page_cost and/or increasing cpu_tuple_cost. Be sure to weigh any decrease in transaction roll- backs and restarts against any overall cost is computed as (disk pages read * seq_page_cost) + (rows scanned * cpu_tuple_cost). By default, seq_page_cost is 1.0 and cpu_tuple_cost is 0.01, so the estimated cost is (358 * 1.0) + (10000 * 0.01)0 码力 | 2727 页 | 11.93 MB | 1 年前3
共 45 条
- 1
- 2
- 3
- 4
- 5













