summaryrefslogtreecommitdiff
path: root/src/include/utils
diff options
context:
space:
mode:
authorMason Sharp2010-11-03 17:06:24 +0000
committerPavan Deolasee2011-05-19 16:45:21 +0000
commitfeeca12a27a8233428daf5187728dd6771ef194d (patch)
tree56d750bd1168862cc9e777ab8c54e20ceb8972e1 /src/include/utils
parentf6cb9c4ebdbdf00027aec825b73b3b961156ed19 (diff)
Improve performance of "multi-step" queries (an on-going process).
We already had code that detected when we can reduce the entire query to a single step, including joins. We also had general code that allowed for handling arbitrary queries that could not be reduced into one step, with the catch that joins will be done at the coordinator level. This commit allows for some joins to be pushed down when possible. For example, in a three-way join, if two tables are co-located, they may be joined in a single step down at the data nodes, and those results will be joined with the third table (on the coordinator, however). In addition, the previous code was based on a SQL/MED patch, which meant when accessing remote tables, it selected all of the columns. With this commit, we project only the needed columns. Written primarily by Pavan Deolasee (join push-dwon and column selection) and Mason Sharp (safe push-down detection). Squashed commit of the following: commit eb50a76cb929fbe4a31d093b43e1589382c892a0 Author: Pavan Deolasee <pavan.deolasee@gmail.com> Date: Wed Oct 27 16:09:28 2010 +0530 Set remote relation stats (pages, rows etc) to a lower value so that NestLoop joins are preferred over other join types. This is necessary until we can handle other join types for remote join reduction commit 69bb66c62f71b9be918475ea65931adb3bbfba20 Author: Pavan Deolasee <pavan.deolasee@gmail.com> Date: Tue Oct 19 12:20:44 2010 +0530 Set aliases properly for join reduction commit 2a313446f3e714ba36c9ccc5c5167309b7c89a95 Author: Mason Sharp <mason_s@users.sourceforge.net> Date: Mon Oct 18 16:15:16 2010 -0400 Added IsJoinReducible to determine if the two plan nodes can be joined. See comments for this function for more details. Basically, we use examine_conditions_walker to check if it is safe to join the two. Partitioned-partitioned joins are safe to collapse, and partitioned-replicated are safe iff one of the nodes does not already contain such a collapsed node. commit f275fa535e9673af0964ecc7ca93ab1b49df2317 Author: Pavan Deolasee <pavan.deolasee@gmail.com> Date: Mon Oct 18 11:53:54 2010 +0530 Fix a bug where rte/alias were not getting set up properly commit 6af07721357944af801a384ed1eb54e363839403 Author: Pavan Deolasee <pavan.deolasee@gmail.com> Date: Mon Oct 18 11:35:43 2010 +0530 Update some missing copy/out/read functions commit 7bcb490dc50eeb1ad1569d90cc5eb759b766aa91 Author: Pavan Deolasee <pavan.deolasee@gmail.com> Date: Mon Oct 18 11:33:54 2010 +0530 Initial implementation of remote join reduction. We still don't have the logic to determine whether its safe to reduce two join trees or not commit aefc06e7bd90c657fb093a923f7b66177687561d Author: Pavan Deolasee <pavan.deolasee@gmail.com> Date: Mon Oct 18 11:29:21 2010 +0530 First step to SQL-med integration. Moving query generation to planning stage
Diffstat (limited to 'src/include/utils')
-rw-r--r--src/include/utils/builtins.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 90955b73f9..4b1463ff74 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -595,7 +595,10 @@ extern Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS);
extern Datum pg_get_function_result(PG_FUNCTION_ARGS);
extern char *deparse_expression(Node *expr, List *dpcontext,
bool forceprefix, bool showimplicit);
+extern List *deparse_context_for_remotequery(const char *aliasname, Oid relid);
+#ifdef PGXC
extern List *deparse_context_for(const char *aliasname, Oid relid);
+#endif
extern List *deparse_context_for_plan(Node *plan, Node *outer_plan,
List *rtable, List *subplans);
extern const char *quote_identifier(const char *ident);