diff options
| author | Bruce Momjian | 2000-06-16 18:59:30 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2000-06-16 18:59:30 +0000 |
| commit | b36d31030be202830cc21e29ec2fd3aaedbc1ea3 (patch) | |
| tree | 29382b652cff87707716010c45babf9d333bce98 /contrib/likeplanning | |
| parent | 648029ec2ee6a09d3354a36d466ee00836bd5e74 (diff) | |
Cleanup README Makefile installs.
Diffstat (limited to 'contrib/likeplanning')
| -rw-r--r-- | contrib/likeplanning/Makefile | 43 | ||||
| -rw-r--r-- | contrib/likeplanning/README | 44 | ||||
| -rw-r--r-- | contrib/likeplanning/disablelike.sql | 39 | ||||
| -rw-r--r-- | contrib/likeplanning/enablelike.sql | 39 |
4 files changed, 0 insertions, 165 deletions
diff --git a/contrib/likeplanning/Makefile b/contrib/likeplanning/Makefile deleted file mode 100644 index 2c779ac8aa7..00000000000 --- a/contrib/likeplanning/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# -# $Header: /cvsroot/pgsql/contrib/likeplanning/Attic/Makefile,v 1.1 2000/06/15 19:04:56 momjian Exp $ -# - -TOPDIR=../.. - -include ../Makefile.global - -NAME = - -PROGRAM = -OBJS = -DOCS = likeplanning.doc -SQLS = disablelike.sql enablelike.sql -BINS = -EXAMPLES= -MODS = - -OTHER_CLEAN = - -all:: - -install: install_doc install_sql - -install_doc: - for inst_file in $(DOCS); do \ - $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_DOCDIR); \ - done - -install_sql: - for inst_file in $(SQLS); do \ - $(INSTALL) $(INSTL_LIB_OPTS) $$inst_file $(CONTRIB_SQLDIR); \ - done - -depend dep: - $(CC) -MM -MG $(CFLAGS) *.c > depend - -clean: - $(RM) *~ $(OBJS) $(MODS) $(PROGRAM) depend $(OTHER_CLEAN) core log - -ifeq (depend,$(wildcard depend)) -include depend -endif diff --git a/contrib/likeplanning/README b/contrib/likeplanning/README deleted file mode 100644 index 0896966376e..00000000000 --- a/contrib/likeplanning/README +++ /dev/null @@ -1,44 +0,0 @@ -This directory contains two SQL scripts that control use of some new -code for planning/optimizing queries containing LIKE and -regular-expression operators. This code was added to Postgres 7.0 late in -beta test, and it hasn't gotten enough testing to warrant turning it on by -default in release 7.0 (although it probably will become default in 7.1). -So, here are some scripts to enable and disable it. You may want to run -these scripts if you have problems with the planner choosing bad plans for -queries involving LIKE or regexps in WHERE clauses. - - -HOW TO USE THE SCRIPTS ----------------------- - -Both scripts must be run as the Postgres superuser. The easiest -way to run an SQL script is - psql -f scriptfile databasename -or you can start psql interactively and enter - \i scriptfile - -enablelike.sql enables use of the new planning code in the database in -which it is run. If you run it in template1, all subsequently-created -databases will use the new code by default. - -disablelike.sql reverts to the old planning code for LIKE, in the database -in which it is run. If you run it in template1, all subsequently-created -databases will use the old code by default. - - -WHAT IT DOES ------------- - -These scripts install (or disable) new code for "selectivity estimation" -of LIKE and regexp operators. Selectivity estimation determines the -estimated number of rows produced by a query or subquery, and that in turn -determines the kind of plan the planner will use. The old selectivity -estimator ignored the pattern being searched for and just produced the -same estimate as for an "=" operator, which of course was usually too low -for a wildcard match. The new code has some knowledge of pattern matching -rules and generates an estimate based on the number of fixed characters and -wildcards present in the pattern. Also, if the pattern has a fixed prefix -that must be matched (such as LIKE 'foo%' or ~ '^foo'), an appropriate -range-query selectivity estimate is produced and factored into the result. - -If you want to look at the code itself, see src/backend/utils/adt/selfuncs.c. diff --git a/contrib/likeplanning/disablelike.sql b/contrib/likeplanning/disablelike.sql deleted file mode 100644 index 353f9dd67be..00000000000 --- a/contrib/likeplanning/disablelike.sql +++ /dev/null @@ -1,39 +0,0 @@ --- This script disables use of the new LIKE-related selectivity estimation --- functions, which are a little too new to be enabled by default in 7.0. --- You can enable them again by running enablelike.sql. - --- Use of the functions will be disabled only in those databases you --- run this script in. If you run it in template1, --- all subsequently-created databases will not use the functions. - --- Be sure to run the script as the Postgres superuser! - -UPDATE pg_operator SET - oprrest = 'eqsel'::regproc, - oprjoin = 'eqjoinsel'::regproc -WHERE oprrest = 'regexeqsel'::regproc; - -UPDATE pg_operator SET - oprrest = 'eqsel'::regproc, - oprjoin = 'eqjoinsel'::regproc -WHERE oprrest = 'icregexeqsel'::regproc; - -UPDATE pg_operator SET - oprrest = 'eqsel'::regproc, - oprjoin = 'eqjoinsel'::regproc -WHERE oprrest = 'likesel'::regproc; - -UPDATE pg_operator SET - oprrest = 'neqsel'::regproc, - oprjoin = 'neqjoinsel'::regproc -WHERE oprrest = 'regexnesel'::regproc; - -UPDATE pg_operator SET - oprrest = 'neqsel'::regproc, - oprjoin = 'neqjoinsel'::regproc -WHERE oprrest = 'icregexnesel'::regproc; - -UPDATE pg_operator SET - oprrest = 'neqsel'::regproc, - oprjoin = 'neqjoinsel'::regproc -WHERE oprrest = 'nlikesel'::regproc; diff --git a/contrib/likeplanning/enablelike.sql b/contrib/likeplanning/enablelike.sql deleted file mode 100644 index efccacdf83c..00000000000 --- a/contrib/likeplanning/enablelike.sql +++ /dev/null @@ -1,39 +0,0 @@ --- This script enables use of the new LIKE-related selectivity estimation --- functions, which are a little too new to be enabled by default in 7.0. --- You can disable them again by running disablelike.sql. - --- Use of the functions will be enabled only in those databases you --- run this script in. If you run it in template1, --- all subsequently-created databases will use the functions. - --- Be sure to run the script as the Postgres superuser! - -UPDATE pg_operator SET - oprrest = 'regexeqsel'::regproc, - oprjoin = 'regexeqjoinsel'::regproc -WHERE oprrest = 'eqsel'::regproc AND oprname = '~'; - -UPDATE pg_operator SET - oprrest = 'icregexeqsel'::regproc, - oprjoin = 'icregexeqjoinsel'::regproc -WHERE oprrest = 'eqsel'::regproc AND oprname = '~*'; - -UPDATE pg_operator SET - oprrest = 'likesel'::regproc, - oprjoin = 'likejoinsel'::regproc -WHERE oprrest = 'eqsel'::regproc AND oprname = '~~'; - -UPDATE pg_operator SET - oprrest = 'regexnesel'::regproc, - oprjoin = 'regexnejoinsel'::regproc -WHERE oprrest = 'neqsel'::regproc AND oprname = '!~'; - -UPDATE pg_operator SET - oprrest = 'icregexnesel'::regproc, - oprjoin = 'icregexnejoinsel'::regproc -WHERE oprrest = 'neqsel'::regproc AND oprname = '!~*'; - -UPDATE pg_operator SET - oprrest = 'nlikesel'::regproc, - oprjoin = 'nlikejoinsel'::regproc -WHERE oprrest = 'neqsel'::regproc AND oprname = '!~~'; |
