1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add new selectivity estimation functions for pattern-matching operators

(LIKE and regexp matches).  These are not yet referenced in pg_operator,
so by default the system will continue to use eqsel/neqsel.
Also, tweak convert_to_scalar() logic so that common prefixes of strings
are stripped off, allowing better accuracy when all strings in a table
share a common prefix.
This commit is contained in:
Tom Lane
2000-04-16 04:41:03 +00:00
parent 8c3b52e7b2
commit 82849df6c6
5 changed files with 1340 additions and 470 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/xoper.sgml,v 1.9 2000/03/31 03:27:41 thomas Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/xoper.sgml,v 1.10 2000/04/16 04:41:01 tgl Exp $
-->
<Chapter Id="xoper">
@ -254,9 +254,9 @@ SELECT (a + b) AS c FROM test_complex;
<para>
You can frequently get away with using either eqsel or neqsel for
operators that have very high or very low selectivity, even if they
aren't really equality or inequality. For example, the regular expression
matching operators (~, ~*, etc) use eqsel on the assumption that they'll
usually only match a small fraction of the entries in a table.
aren't really equality or inequality. For example, the
approximate-equality geometric operators use eqsel on the assumption that
they'll usually only match a small fraction of the entries in a table.
</para>
<para>