mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
pgindent run for 9.4
This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
This commit is contained in:
@ -90,7 +90,7 @@ t_isprint(const char *ptr)
|
||||
|
||||
|
||||
/*
|
||||
* Set up to read a file using tsearch_readline(). This facility is
|
||||
* Set up to read a file using tsearch_readline(). This facility is
|
||||
* better than just reading the file directly because it provides error
|
||||
* context pointing to the specific line where a problem is detected.
|
||||
*
|
||||
@ -168,7 +168,7 @@ tsearch_readline_callback(void *arg)
|
||||
|
||||
/*
|
||||
* We can't include the text of the config line for errors that occur
|
||||
* during t_readline() itself. This is only partly a consequence of our
|
||||
* during t_readline() itself. This is only partly a consequence of our
|
||||
* arms-length use of that routine: the major cause of such errors is
|
||||
* encoding violations, and we daren't try to print error messages
|
||||
* containing badly-encoded data.
|
||||
|
@ -319,7 +319,7 @@ tsquery_opr_selec(QueryItem *item, char *operand,
|
||||
* exclusive. We treat occurrences as independent events.
|
||||
*
|
||||
* This is only a good plan if we have a pretty fair number of
|
||||
* MCELEMs available; we set the threshold at 100. If no stats or
|
||||
* MCELEMs available; we set the threshold at 100. If no stats or
|
||||
* insufficient stats, arbitrarily use DEFAULT_TS_MATCH_SEL*4.
|
||||
*/
|
||||
if (lookup == NULL || length < 100)
|
||||
|
@ -114,13 +114,13 @@ ts_typanalyze(PG_FUNCTION_ARGS)
|
||||
* language's frequency table, where K is the target number of entries in
|
||||
* the MCELEM array plus an arbitrary constant, meant to reflect the fact
|
||||
* that the most common words in any language would usually be stopwords
|
||||
* so we will not actually see them in the input. We assume that the
|
||||
* so we will not actually see them in the input. We assume that the
|
||||
* distribution of word frequencies (including the stopwords) follows Zipf's
|
||||
* law with an exponent of 1.
|
||||
*
|
||||
* Assuming Zipfian distribution, the frequency of the K'th word is equal
|
||||
* to 1/(K * H(W)) where H(n) is 1/2 + 1/3 + ... + 1/n and W is the number of
|
||||
* words in the language. Putting W as one million, we get roughly 0.07/K.
|
||||
* words in the language. Putting W as one million, we get roughly 0.07/K.
|
||||
* Assuming top 10 words are stopwords gives s = 0.07/(K + 10). We set
|
||||
* epsilon = s/10, which gives bucket width w = (K + 10)/0.007 and
|
||||
* maximum expected hashtable size of about 1000 * (K + 10).
|
||||
@ -161,7 +161,7 @@ compute_tsvector_stats(VacAttrStats *stats,
|
||||
TrackItem *item;
|
||||
|
||||
/*
|
||||
* We want statistics_target * 10 lexemes in the MCELEM array. This
|
||||
* We want statistics_target * 10 lexemes in the MCELEM array. This
|
||||
* multiplier is pretty arbitrary, but is meant to reflect the fact that
|
||||
* the number of individual lexeme values tracked in pg_statistic ought to
|
||||
* be more than the number of values for a simple scalar column.
|
||||
@ -232,7 +232,7 @@ compute_tsvector_stats(VacAttrStats *stats,
|
||||
|
||||
/*
|
||||
* We loop through the lexemes in the tsvector and add them to our
|
||||
* tracking hashtable. Note: the hashtable entries will point into
|
||||
* tracking hashtable. Note: the hashtable entries will point into
|
||||
* the (detoasted) tsvector value, therefore we cannot free that
|
||||
* storage until we're done.
|
||||
*/
|
||||
@ -299,7 +299,7 @@ compute_tsvector_stats(VacAttrStats *stats,
|
||||
|
||||
/*
|
||||
* Construct an array of the interesting hashtable items, that is,
|
||||
* those meeting the cutoff frequency (s - epsilon)*N. Also identify
|
||||
* those meeting the cutoff frequency (s - epsilon)*N. Also identify
|
||||
* the minimum and maximum frequencies among these items.
|
||||
*
|
||||
* Since epsilon = s/10 and bucket_width = 1/epsilon, the cutoff
|
||||
@ -332,7 +332,7 @@ compute_tsvector_stats(VacAttrStats *stats,
|
||||
|
||||
/*
|
||||
* If we obtained more lexemes than we really want, get rid of those
|
||||
* with least frequencies. The easiest way is to qsort the array into
|
||||
* with least frequencies. The easiest way is to qsort the array into
|
||||
* descending frequency order and truncate the array.
|
||||
*/
|
||||
if (num_mcelem < track_len)
|
||||
@ -363,7 +363,7 @@ compute_tsvector_stats(VacAttrStats *stats,
|
||||
* they get sorted on frequencies. The rationale is that we
|
||||
* usually search through most common elements looking for a
|
||||
* specific value, so we can grab its frequency. When values are
|
||||
* presorted we can employ binary search for that. See
|
||||
* presorted we can employ binary search for that. See
|
||||
* ts_selfuncs.c for a real usage scenario.
|
||||
*/
|
||||
qsort(sort_table, num_mcelem, sizeof(TrackItem *),
|
||||
|
@ -23,8 +23,8 @@
|
||||
|
||||
/*
|
||||
* Given the base name and extension of a tsearch config file, return
|
||||
* its full path name. The base name is assumed to be user-supplied,
|
||||
* and is checked to prevent pathname attacks. The extension is assumed
|
||||
* its full path name. The base name is assumed to be user-supplied,
|
||||
* and is checked to prevent pathname attacks. The extension is assumed
|
||||
* to be safe.
|
||||
*
|
||||
* The result is a palloc'd string.
|
||||
@ -37,7 +37,7 @@ get_tsearch_config_filename(const char *basename,
|
||||
char *result;
|
||||
|
||||
/*
|
||||
* We limit the basename to contain a-z, 0-9, and underscores. This may
|
||||
* We limit the basename to contain a-z, 0-9, and underscores. This may
|
||||
* be overly restrictive, but we don't want to allow access to anything
|
||||
* outside the tsearch_data directory, so for instance '/' *must* be
|
||||
* rejected, and on some platforms '\' and ':' are risky as well. Allowing
|
||||
@ -61,7 +61,7 @@ get_tsearch_config_filename(const char *basename,
|
||||
|
||||
/*
|
||||
* Reads a stop-word file. Each word is run through 'wordop'
|
||||
* function, if given. wordop may either modify the input in-place,
|
||||
* function, if given. wordop may either modify the input in-place,
|
||||
* or palloc a new version.
|
||||
*/
|
||||
void
|
||||
|
@ -330,7 +330,7 @@ TParserInit(char *str, int len)
|
||||
|
||||
/*
|
||||
* Use of %.*s here is a bit risky since it can misbehave if the data is
|
||||
* not in what libc thinks is the prevailing encoding. However, since
|
||||
* not in what libc thinks is the prevailing encoding. However, since
|
||||
* this is just a debugging aid, we choose to live with that.
|
||||
*/
|
||||
fprintf(stderr, "parsing \"%.*s\"\n", len, str);
|
||||
|
Reference in New Issue
Block a user