Add new selectivity estimation functions for pattern-matching operators
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/xoper.sgml | modified | +4 −4 |
| src/backend/optimizer/path/indxpath.c | modified | +22 −255 |
| src/backend/utils/adt/selfuncs.c | modified | +1228 −199 |
| src/include/catalog/pg_proc.h | modified | +27 −1 |
| src/include/utils/builtins.h | modified | +58 −10 |