public:it:postgresql

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
public:it:postgresql [2021/01/19 09:46] – [pgAdmin] oakfirepublic:it:postgresql [2024/07/19 14:08] (当前版本) – [Tips] oakfire
行 1: 行 1:
 ====== PostgresQL ====== ====== PostgresQL ======
   * [[https://www.postgresql.org|Official site]]   * [[https://www.postgresql.org|Official site]]
- +  * [[https://mp.weixin.qq.com/s/xf7qb4oAVHyi4_U32FSKPA|全方位对比 Postgres 和 MySQL (2023 版)]] 
 +    * 对象层次结构,Postgres 比 MySQL 多了一层 ''模式 Schema''; 
 +    * Postgres 提供更强大的事务支持 
 +    * Postgres 支持开箱即用的附加行级安全 (RLS),而 MySQL 需要创建额外的视图来模拟此行为。 
 +    * Postgres 的查询优化器更优秀 
 +    * Postgres 和 MySQL 都支持 JSON。Postgres 支持的功能更多 
 +    * Postgres 对 CTE 的支持更全面 
 +    * 一般来说,Postgres 实现的 Window Functions 比 MySQL 实现更高效且性能更好。 
 +    * Postgres 支持多种扩展。最出色的是 PostGIS,它为 Postgres 带来了地理空间能力;pgvector 用于进行 AI 应用的向量搜索 
 +    * Postgres 的SQL语句更加严格 
 +    * Postgres 采用在每个连接上生成一个新进程的方式工作 
 +    * 在高负载下,Postgres 存在臭名昭著的 XID wraparound 问题。 
 +===== Tips ===== 
 +  * 查看数据库大小:<code> 
 +psql -U postgres -d postgres -h 127.0.0.1 -W 
 +SELECT pg_size_pretty(pg_database_size('db_name')); 
 +\q 
 +</code> 
 +  * 使用 uuid 作为主键时,最好使用 uuid v7 , 对大数据集性能有提升。[[https://maciejwalkowiak.com/blog/postgres-uuid-primary-key/|postgres-uuid-primary-key]]
 ===== pgAdmin ===== ===== pgAdmin =====
   * [[https://www.pgadmin.org/|pgadmin.org]]   * [[https://www.pgadmin.org/|pgadmin.org]]
  • public/it/postgresql.1611020778.txt.gz
  • 最后更改: 2021/01/19 09:46
  • oakfire