Browse files

some doc updates

  • Loading branch information...
markokr committed Mar 13, 2007
1 parent 355266a commit 689c37bbea00924940d41563e5d19057524bba43
Showing with 47 additions and 20 deletions.
  1. +2 −2 Makefile
  2. +7 −9 doc/overview.txt
  3. +38 −9 doc/syntax.txt
@@ -17,9 +17,9 @@ PG_CPPFLAGS = -I$(PQINC)
DIST_FILES = Makefile src/plproxy.h src/scanner.l src/parser.y \
- sql/*.sql expected/*.out db/*.sql doc/*.txt doc/Makefile \
+ sql/*.sql expected/*.out config/*.sql doc/*.txt doc/Makefile \
-DIST_DIRS = src sql expected db doc
+DIST_DIRS = src sql expected config doc
# regression testing setup
@@ -4,18 +4,16 @@
-== What is pl/proxy - a short history ==
+== Overview ==
-Short version - pl/proxy is a proxy language used for remote database
-procedure calls and data partitioning between databases based on hashing
-field values.
+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.
-Longer version -
-== subpages ==
Detailed info: ./LanguageSyntax ./ClusterConfig
@@ -10,28 +10,57 @@ if it is missing, there will be default query generated based on proxy
function signature.
=== CONNECT ===
-`CONNECT 'libpq connstr';`
+CONNECT 'libpq connstr';
+Specifies exact location where to connect and execute the query.
+If several functions have same connstr, they will use same connection.
=== CLUSTER ===
+CLUSTER 'cluster_name';
-`CLUSTER 'cluster_name' | cluster_func(..);`
+Specifies exact cluster name to be run on. The cluster name will
+be passed to plproxy.get_cluster_* functions.
+CLUSTER cluster_func(..);
+Cluster name can be dynamically decided upon proxy function arguments.
+`cluster_func` should returns text value for final cluster name.
=== RUN ON ===
+Query will be run on all partitions in cluster in parallel.
+Query will be run on random partition.
-RUN ON (partition_func(..) | ALL | ANY | <NR>) ;
+Run on partition number `<NR>`.
+RUN ON partition_func(..);
- * Arguments for hashfunc and SELECT can be both $1 and full name.
- * Hashfunc can return "setof int4", several servers are tagged then.
- * If query is ran on several server, the execution will happen in parallel.
+Run partition_func() which should return one or more hash values. (int4)
+Query will be run on tagged partitions. If more than one partition was
+tagged, query will be sent in parallel to them.
=== SELECT ===
SELECT .... ;
-By default runs SELECT * from funcname(..); on remote side
-where funcname is name of plproxy function.
- * Result fields will be mapped on name.
+=== Argument substitution ===
+Proxy function arguments can be referenced using name or `$n` syntax.
+Everything that is not argument reference is just passed on.

0 comments on commit 689c37b

Please sign in to comment.