postgresql/src/backend/tsearch
Tom Lane c9e845f82a Tweak tsmatchsel() so that it examines the structure of the tsquery whenever
possible (ie, whenever the tsquery is a constant), even when no statistics
are available for the tsvector.  For example, foo @@ 'a & b'::tsquery
can be expected to be more selective than foo @@ 'a'::tsquery, whether
or not we know anything about foo.  We use DEFAULT_TS_MATCH_SEL as the assumed
selectivity of individual query terms when no stats are available, then
combine the terms according to the query's AND/OR structure as usual.

Per experimentation with Artur Dabrowski's example.  (The fact that there
are no stats available in that example is a problem in itself, but
nonetheless tsmatchsel should be smarter about the case.)

Back-patch to 8.4 to keep all versions of tsmatchsel() in sync.
2010-07-31 03:27:48 +00:00
..
dict.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
dict_ispell.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
dict_simple.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
dict_synonym.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
dict_thesaurus.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
hunspell_sample.affix Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
ispell_sample.affix Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
ispell_sample.dict Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
Makefile Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
regis.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
spell.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
synonym_sample.syn Add prefix support for synonym dictionary 2009-08-14 14:53:20 +00:00
thesaurus_sample.ths Have text search thesaurus files use "?" for stop words. 2007-11-10 15:39:34 +00:00
to_tsany.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
ts_locale.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
ts_parse.c pgindent run for 9.0 2010-02-26 02:01:40 +00:00
ts_selfuncs.c Tweak tsmatchsel() so that it examines the structure of the tsquery whenever 2010-07-31 03:27:48 +00:00
ts_typanalyze.c pgindent run for 9.0, second run 2010-07-06 19:19:02 +00:00
ts_utils.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
wparser.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
wparser_def.c Adjust comments about avoiding use of printf's %.*s. 2010-05-09 02:16:00 +00:00