1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-22 21:53:06 +03:00
Files
postgres/doc/src/sgml
Tom Lane 7d08ce286c Distinguish selectivity of < from <= and > from >=.
Historically, the selectivity functions have simply not distinguished
< from <=, or > from >=, arguing that the fraction of the population that
satisfies the "=" aspect can be considered to be vanishingly small, if the
comparison value isn't any of the most-common-values for the variable.
(If it is, the code path that executes the operator against each MCV will
take care of things properly.)  But that isn't really true unless we're
dealing with a continuum of variable values, and in practice we seldom are.
If "x = const" would estimate a nonzero number of rows for a given const
value, then it follows that we ought to estimate different numbers of rows
for "x < const" and "x <= const", even if the const is not one of the MCVs.
Handling this more honestly makes a significant difference in edge cases,
such as the estimate for a tight range (x BETWEEN y AND z where y and z
are close together).

Hence, split scalarltsel into scalarltsel/scalarlesel, and similarly
split scalargtsel into scalargtsel/scalargesel.  Adjust <= and >=
operator definitions to reference the new selectivity functions.
Improve the core ineq_histogram_selectivity() function to make a
correction for equality.  (Along the way, I learned quite a bit about
exactly why that function gives good answers, which I tried to memorialize
in improved comments.)

The corresponding join selectivity functions were, and remain, just stubs.
But I chose to split them similarly, to avoid confusion and to prevent the
need for doing this exercise again if someone ever makes them less stubby.

In passing, change ineq_histogram_selectivity's clamp for extreme
probability estimates so that it varies depending on the histogram
size, instead of being hardwired at 0.0001.  With the default histogram
size of 100 entries, you still get the old clamp value, but bigger
histograms should allow us to put more faith in edge values.

Tom Lane, reviewed by Aleksander Alekseev and Kuntal Ghosh

Discussion: https://postgr.es/m/12232.1499140410@sss.pgh.pa.us
2017-09-13 11:12:39 -04:00
..
2017-09-06 11:22:43 -04:00
2017-06-13 11:28:52 -04:00
2017-09-11 11:21:27 -04:00
2017-03-09 16:33:02 -08:00
2017-04-05 13:18:32 -04:00
2017-05-15 12:09:19 -04:00
2017-08-05 09:32:42 -04:00
2017-08-17 11:47:40 -04:00
2017-01-03 13:48:53 -05:00
2017-09-06 11:22:43 -04:00
2017-09-11 11:21:27 -04:00
2017-03-30 14:18:53 -04:00
2017-08-17 11:47:40 -04:00
2017-03-30 14:18:53 -04:00
2017-03-30 14:18:53 -04:00
2017-03-30 17:13:44 -04:00
2016-09-12 19:19:41 -04:00
2017-03-30 14:18:53 -04:00
2017-06-17 19:03:12 -04:00
2017-09-06 11:22:43 -04:00
2017-04-06 22:09:11 -04:00
2017-03-03 15:03:03 -05:00
2017-09-06 11:22:43 -04:00
2017-09-06 11:22:43 -04:00
2017-09-06 11:22:43 -04:00
2017-09-06 11:22:43 -04:00
2017-09-06 11:22:43 -04:00
2017-09-06 11:22:43 -04:00
2017-08-15 14:37:44 -04:00
2017-04-12 15:41:41 -04:00
2017-09-06 11:22:43 -04:00
2017-02-13 11:06:11 -05:00
2017-05-09 23:57:52 -04:00
2017-03-23 14:16:45 -04:00

<!-- doc/src/sgml/README.links -->

Linking within SGML documents can be confusing, so here is a summary:


Intra-document Linking
----------------------

<xref>
	use to get chapter/section number from the title of the target
	link, or xreflabel if defined at the target, or refentrytitle if target
        is a refentry;  has no close tag
	http://www.oasis-open.org/docbook/documentation/reference/html/xref.html

<link>
	use to supply text for the link, requires </link>
	http://www.oasis-open.org/docbook/documentation/reference/html/link.html

linkend=
	controls the target of the link/xref, required

endterm=
	for <xref>, allows the text of the link/xref to be taken from a
	different link target title


External Linking
----------------

<ulink>
	like <link>, but uses a URL (not a document target);  requires
	</ulink>; if no text is specified, the URL appears as the link
	text
	http://www.oasis-open.org/docbook/documentation/reference/html/ulink.html

url=
	used by <ulink> to specify the URL, required


Guidelines
----------

o  If you want to supply text, use <link>, else <xref>
o  Do not use text with <ulink> so the URL appears in printed output
o  Specific nouns like GUC variables, SQL commands, and contrib modules
   usually have xreflabels