Commit 3ddc1148 authored by Paul Ramsey's avatar Paul Ramsey

Add costs to functions in the form of macros:

_COST_LOW, _COST_MEDIUM, _COST_HIGH
Macros are set in sqldefines.h.in and are switched
on PgSQL version. Prior to PG12, costs should be
small or nonexistent, to avoid SQL inlining issues.
After Pg12, costs can be higher to hopefully
force more parallelism in plans.
Closes #4344


git-svn-id: http://svn.osgeo.org/postgis/trunk@17307 b70326c6-7e19-0410-871a-916f4a2858ee
parent 0bf98c8c
Pipeline #50993049 passed with stage
in 26 minutes and 6 seconds
This diff is collapsed.
This diff is collapsed.
......@@ -21,6 +21,25 @@
#define _PARALLEL_RESTRICTED
#endif
/*
* High costs can only be used for PostGIS 3/PgSQL 12
* where the support functions have been used in
* place of index SQL inlining.
* See https://trac.osgeo.org/postgis/ticket/3675
* for sideffects of costing inlined SQL.
*/
#if POSTGIS_PGSQL_VERSION >= 120
#define _COST_DEFAULT COST 1
#define _COST_LOW COST 100
#define _COST_MEDIUM COST 1000
#define _COST_HIGH COST 10000
#else
#define _COST_DEFAULT COST 1
#define _COST_LOW COST 1
#define _COST_MEDIUM COST 10
#define _COST_HIGH COST 10
#endif
/*
* Define the build date and the version number
* (these substitiutions are done with extra quotes sinces CPP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment