PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_operator.h"
#include "commands/vacuum.h"
#include "common/hashfn.h"
#include "tsearch/ts_type.h"
#include "utils/builtins.h"
#include "varatt.h"
Go to the source code of this file.
Data Structures | |
struct | LexemeHashKey |
struct | TrackItem |
Functions | |
static void | compute_tsvector_stats (VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, int samplerows, double totalrows) |
static void | prune_lexemes_hashtable (HTAB *lexemes_tab, int b_current) |
static uint32 | lexeme_hash (const void *key, Size keysize) |
static int | lexeme_match (const void *key1, const void *key2, Size keysize) |
static int | lexeme_compare (const void *key1, const void *key2) |
static int | trackitem_compare_frequencies_desc (const void *e1, const void *e2, void *arg) |
static int | trackitem_compare_lexemes (const void *e1, const void *e2, void *arg) |
Datum | ts_typanalyze (PG_FUNCTION_ARGS) |
|
static |
Definition at line 141 of file ts_typanalyze.c.
References VacAttrStats::anl_context, ARRPTR, Assert, VacAttrStats::attstattarget, cstring_to_text_with_len(), CurrentMemoryContext, DatumGetPointer(), DatumGetTSVector(), DEBUG3, TrackItem::delta, elog, HASHCTL::entrysize, TrackItem::frequency, HASHCTL::hash, HASH_COMPARE, HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_ENTER, HASH_FUNCTION, hash_get_num_entries(), hash_key(), hash_search(), hash_seq_init(), hash_seq_search(), HASHCTL::hcxt, i, j, TrackItem::key, HASHCTL::keysize, WordEntry::len, LexemeHashKey::length, LexemeHashKey::lexeme, lexeme_hash(), lexeme_match(), HASHCTL::match, Max, MemoryContextSwitchTo(), Min, VacAttrStats::numnumbers, VacAttrStats::numvalues, palloc(), pfree(), PointerGetDatum(), WordEntry::pos, prune_lexemes_hashtable(), qsort_interruptible(), TSVectorData::size, VacAttrStats::stacoll, VacAttrStats::stadistinct, VacAttrStats::stakind, VacAttrStats::stanullfrac, VacAttrStats::stanumbers, VacAttrStats::staop, VacAttrStats::stats_valid, VacAttrStats::statypalign, VacAttrStats::statypbyval, VacAttrStats::statypid, VacAttrStats::statyplen, VacAttrStats::stavalues, VacAttrStats::stawidth, STRPTR, trackitem_compare_frequencies_desc(), trackitem_compare_lexemes(), TSVectorGetDatum(), vacuum_delay_point(), value, and VARSIZE_ANY.
Referenced by ts_typanalyze().
|
static |
Definition at line 500 of file ts_typanalyze.c.
References LexemeHashKey::length, and LexemeHashKey::lexeme.
Referenced by lexeme_match(), and trackitem_compare_lexemes().
Definition at line 478 of file ts_typanalyze.c.
References DatumGetUInt32(), hash_any(), sort-test::key, LexemeHashKey::length, and LexemeHashKey::lexeme.
Referenced by compute_tsvector_stats().
|
static |
Definition at line 490 of file ts_typanalyze.c.
References lexeme_compare().
Referenced by compute_tsvector_stats().
|
static |
Definition at line 453 of file ts_typanalyze.c.
References TrackItem::delta, elog, ERROR, TrackItem::frequency, HASH_REMOVE, hash_search(), hash_seq_init(), hash_seq_search(), TrackItem::key, LexemeHashKey::lexeme, and pfree().
Referenced by compute_tsvector_stats().
|
static |
Definition at line 518 of file ts_typanalyze.c.
References TrackItem::frequency.
Referenced by compute_tsvector_stats().
|
static |
Definition at line 530 of file ts_typanalyze.c.
References lexeme_compare().
Referenced by compute_tsvector_stats().
Datum ts_typanalyze | ( | PG_FUNCTION_ARGS | ) |
Definition at line 58 of file ts_typanalyze.c.
References VacAttrStats::attstattarget, VacAttrStats::compute_stats, compute_tsvector_stats(), default_statistics_target, VacAttrStats::minrows, PG_GETARG_POINTER, and PG_RETURN_BOOL.