aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/pathnode.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-11-21 14:05:46 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-11-21 14:05:46 -0500
commitc2ea2285e978d9289084846a3343cef7d261d880 (patch)
tree97546a6da2b2eaa1275d311a04810658724b5547 /src/backend/optimizer/util/pathnode.c
parent4077fb4d1d34ad04dfb95ba676c2b43ea1f1da53 (diff)
downloadpostgresql-c2ea2285e978d9289084846a3343cef7d261d880.tar.gz
postgresql-c2ea2285e978d9289084846a3343cef7d261d880.zip
Simplify API for initially hooking custom-path providers into the planner.
Instead of register_custom_path_provider and a CreateCustomScanPath callback, let's just provide a standard function hook in set_rel_pathlist. This is more flexible than what was previously committed, is more like the usual conventions for planner hooks, and requires less support code in the core. We had discussed this design (including centralizing the set_cheapest() calls) back in March or so, so I'm not sure why it wasn't done like this already.
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r--src/backend/optimizer/util/pathnode.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 121b9ff3e45..319e8b2c379 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -27,7 +27,6 @@
#include "optimizer/var.h"
#include "parser/parsetree.h"
#include "utils/lsyscache.h"
-#include "utils/memutils.h"
#include "utils/selfuncs.h"
@@ -1927,50 +1926,3 @@ reparameterize_path(PlannerInfo *root, Path *path,
}
return NULL;
}
-
-/*****************************************************************************
- * creation of custom-plan paths
- *****************************************************************************/
-
-static List *custom_path_providers = NIL;
-
-/*
- * register_custom_path_provider
- *
- * Register a table of callback functions which implements a custom-path
- * provider. This allows extension to provide additional (hopefully faster)
- * methods of scanning a relation.
- */
-void
-register_custom_path_provider(const CustomPathMethods *cpp_methods)
-{
- MemoryContext oldcxt;
-
- oldcxt = MemoryContextSwitchTo(TopMemoryContext);
- custom_path_providers = lappend(custom_path_providers,
- (void *) cpp_methods);
- MemoryContextSwitchTo(oldcxt);
-}
-
-/*
- * create_customscan_paths
- *
- * Invoke custom path provider callbacks. If the callback determines that
- * the custom-path provider can handle this relation, it can add one or more
- * paths using add_path().
- */
-void
-create_customscan_paths(PlannerInfo *root,
- RelOptInfo *baserel,
- RangeTblEntry *rte)
-{
- ListCell *cell;
-
- foreach(cell, custom_path_providers)
- {
- const CustomPathMethods *cpp_methods = lfirst(cell);
-
- if (cpp_methods->CreateCustomScanPath)
- cpp_methods->CreateCustomScanPath(root, baserel, rte);
- }
-}