系统管理 维护监控 简单生活
pgsql
postgresql 分布式查询方法
九 4th
转:http://www.qtchina.net/?q=node/322
1. 使用pgpoll-II 的并行查询功能,可以同时执行多服务器查询语句
2. 使用PL/Proxy,
3. 商业方法,EnterpriseDB Postgres Plus中有一个In-Memory Distributed Caching Layer或者可以解决多个数据库间进行数据处理,EnterpriseDB的GridSQL也可以实现分布式的数据库应用
skype_plproxy
九 4th
转:https://developer.skype.com/SkypeGarage/DbProjects/PlProxy
1.introduction
PL/Proxy is a proxy language used for remote database procedure calls and data partitioning between databases based on hashing field values.
Main idea is that proxy function will be created with same signature as remote function to be called, so only destination info needs to be specified inside proxy function body.
PL/Proxy 是一种代理语言,主要用于是数据库远程过程调用和通过hash一个字段把数据分布到几个数据库上.
主要原理是代理服务器通过创建和远程(被代理的那个功能)节点相同调用指纹,所以,在代理的功能主体中只需要目的地信息
2. Features
- PL/Proxy functions detect remote functions to be called from their own signature.
- Function can be run on one, some or all members of the cluster.
- If query is executed on several partitions, it will happen in parallel.
- Queries are run in auto-commit mode on the remote server.
- Query parameters are sent separately from query body, thus avoiding quoting/unquoting overhead on both sides.
- If proxy and partition backend versions match, PL/Proxy tries to use binary I/O if possible.
1. PL/Proxy函数从它们自己的指纹里判断需要调用的远端函数 2. 函数可以运行在一个或是几个或是所有集群节点上 3. 如果一个请求需要几个分区来执行,他们将是并行的 4. 查询在远程服务器上是运行在自动提交模式的 5. 查询的参数和查询主体是分开的,从而可以减少引用/反调用双方的开销 6. 如果查询和分区后端的版本匹配,PL/Proxy尽可能的尝试使用二进制I / O
3. Restrictions
- PL/Proxy launches connections into each part from each backend, so in heavy-duty environment is necessary to put pooler between PL/Proxy and partitions. We have specially for that developed ../PgBouncer which is a pooler that can do statement-based pooling - release server after each SQL statement.
PL/Proxy 查询到每一个分区都会在后端建产一个连接,如果在重要的的环境里,有必要在PL 和千分区之间放一个连接沲
最新评论