MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fts0fts.cc File Reference
#include "trx0roll.h"
#include "row0mysql.h"
#include "row0upd.h"
#include "dict0types.h"
#include "row0sel.h"
#include "fts0fts.h"
#include "fts0priv.h"
#include "fts0types.h"
#include "fts0types.ic"
#include "fts0vlc.ic"
#include "dict0priv.h"
#include "dict0stats.h"
#include "btr0pcur.h"
#include "ha_prototypes.h"
Include dependency graph for fts0fts.cc:

Go to the source code of this file.

Classes

struct  fts_aux_table_t

Macros

#define FTS_MAX_ID_LEN   32
#define FTS_MAX_CACHE_SIZE_IN_MB   "cache_size_in_mb"

Functions

UNIV_INLINE ibool fts_is_stop_signalled (fts_t *fts)
UNIV_INTERN void fts_cache_init (fts_cache_t *cache)
UNIV_INTERN fts_cache_tfts_cache_create (dict_table_t *table)
UNIV_INTERN void fts_add_index (dict_index_t *index, dict_table_t *table)
UNIV_INTERN ibool fts_check_cached_index (dict_table_t *table)
UNIV_INTERN dberr_t fts_drop_index (dict_table_t *table, dict_index_t *index, trx_t *trx)
UNIV_INTERN void fts_que_graph_free_check_lock (fts_table_t *fts_table, const fts_index_cache_t *index_cache, que_t *graph)
UNIV_INTERN CHARSET_INFOfts_index_get_charset (dict_index_t *index)
UNIV_INTERN fts_index_cache_tfts_cache_index_cache_create (dict_table_t *table, dict_index_t *index)
UNIV_INTERN void fts_cache_clear (fts_cache_t *cache, ibool free_words)
UNIV_INLINE fts_index_cache_tfts_get_index_cache (fts_cache_t *cache, const dict_index_t *index)
UNIV_INTERN void fts_cache_destroy (fts_cache_t *cache)
UNIV_INTERN void fts_cache_node_add_positions (fts_cache_t *cache, fts_node_t *node, doc_id_t doc_id, ib_vector_t *positions)

Variables

UNIV_INTERN ulong fts_max_cache_size
UNIV_INTERN bool fts_need_sync = false
UNIV_INTERN ulong fts_max_total_cache_size
UNIV_INTERN ulong fts_result_cache_limit
UNIV_INTERN ulong fts_max_token_size
UNIV_INTERN ulong fts_min_token_size
ib_time_t elapsed_time = 0
ulint n_nodes = 0
const ulint UTF8_ERROR = 0xFFFFFFFF
UNIV_INTERN char * fts_internal_tbl_name = NULL
const char * fts_default_stopword []
const fts_index_selector_t fts_index_selector []

Detailed Description

Full Text Search interface

Definition in file fts0fts.cc.

Macro Definition Documentation

#define FTS_MAX_CACHE_SIZE_IN_MB   "cache_size_in_mb"

Column name from the FTS config table

Definition at line 45 of file fts0fts.cc.

Function Documentation

UNIV_INTERN void fts_add_index ( dict_index_t index,
dict_table_t table 
)

Add a newly create index into FTS cache

Parameters
indexFTS index to be added
tabletable

Definition at line 685 of file fts0fts.cc.

Here is the call graph for this function:

UNIV_INTERN void fts_cache_clear ( fts_cache_t cache,
ibool  free_words 
)

Clear cache. If the shutdown flag is TRUE then the cache can contain data that needs to be freed. For regular clear as part of normal working we assume the caller has freed all resources.

Parameters
cachein: cache
free_wordsin: TRUE if free in memory word cache.

Definition at line 1087 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN fts_cache_t* fts_cache_create ( dict_table_t table)

Create a FTS cache.

Parameters
tablein: table owns the FTS cache

Definition at line 621 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN void fts_cache_destroy ( fts_cache_t cache)

Free the FTS cache.

Parameters
cachein: cache

Definition at line 1212 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN fts_index_cache_t* fts_cache_index_cache_create ( dict_table_t table,
dict_index_t index 
)

Create an FTS index cache.

Returns
Index Cache
Parameters
tablein: table with FTS index
indexin: FTS index

Definition at line 1000 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN void fts_cache_init ( fts_cache_t cache)

Initialize FTS cache.

Parameters
cachein: cache to initialize

Definition at line 590 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN void fts_cache_node_add_positions ( fts_cache_t cache,
fts_node_t node,
doc_id_t  doc_id,
ib_vector_t positions 
)

Add the given doc_id/word positions to the given node's ilist.

Parameters
cachein: cache
nodein: word node
doc_idin: doc id
positionsin: fts_token_t::positions

Definition at line 1293 of file fts0fts.cc.

Here is the call graph for this function:

UNIV_INTERN ibool fts_check_cached_index ( dict_table_t table)

Check indexes in the fts->indexes is also present in index cache and table->indexes list

Returns
TRUE if all indexes match
Parameters
tablein: Table where indexes are dropped

Definition at line 801 of file fts0fts.cc.

UNIV_INTERN dberr_t fts_drop_index ( dict_table_t table,
dict_index_t index,
trx_t trx 
)

Drop auxiliary tables related to an FTS index

Returns
DB_SUCCESS or error number
Parameters
tablein: Table where indexes are dropped
indexin: Index to be dropped
trxin: Transaction for the drop

Definition at line 837 of file fts0fts.cc.

Here is the call graph for this function:

UNIV_INLINE fts_index_cache_t* fts_get_index_cache ( fts_cache_t cache,
const dict_index_t index 
)

Search the index specific cache for a particular FTS index.

Returns
the index cache else NULL
Parameters
cachein: cache to search
indexin: index to search for

Definition at line 1148 of file fts0fts.cc.

Here is the call graph for this function:

UNIV_INTERN CHARSET_INFO* fts_index_get_charset ( dict_index_t index)

Create an FTS index cache.

Parameters
indexin: FTS index

Definition at line 955 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INLINE ibool fts_is_stop_signalled ( fts_t fts)
Parameters
ftsin: fts instance

Definition at line 327 of file fts0fts.cc.

UNIV_INTERN void fts_que_graph_free_check_lock ( fts_table_t fts_table,
const fts_index_cache_t index_cache,
que_t graph 
)

Free the query graph but check whether dict_sys->mutex is already held

Parameters
fts_tablein: FTS table
index_cachein: FTS index cache
graphin: query graph

Definition at line 918 of file fts0fts.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* fts_default_stopword[]
InnoDB default stopword list:

There are different versions of stopwords, the stop words listed below comes from "Google Stopword" list. Reference: http://meta.wikimedia.org/wiki/Stop_word_list/google_stop_word_list. The final version of InnoDB default stopword list is still pending for decision

Definition at line 107 of file fts0fts.cc.

const fts_index_selector_t fts_index_selector[]
Initial value:
{
{ 9, "INDEX_1" },
{ 65, "INDEX_2" },
{ 70, "INDEX_3" },
{ 75, "INDEX_4" },
{ 80, "INDEX_5" },
{ 85, "INDEX_6" },
{ 0 , NULL }
}

FTS auxiliary INDEX split intervals.

Definition at line 223 of file fts0fts.cc.

UNIV_INTERN char* fts_internal_tbl_name = NULL
variable to record innodb_fts_internal_tbl_name for information

schema table INNODB_FTS_INSERTED etc.

Definition at line 99 of file fts0fts.cc.

UNIV_INTERN ulong fts_max_cache_size
This is maximum FTS cache for each table and would be

a configurable variable

Definition at line 49 of file fts0fts.cc.

UNIV_INTERN ulong fts_max_token_size

Variable specifying the maximum FTS max token size

Definition at line 63 of file fts0fts.cc.

UNIV_INTERN ulong fts_max_total_cache_size

Variable specifying the total memory allocated for FTS cache

Definition at line 56 of file fts0fts.cc.

UNIV_INTERN ulong fts_min_token_size

Variable specifying the minimum FTS max token size

Definition at line 66 of file fts0fts.cc.

UNIV_INTERN bool fts_need_sync = false
Whether the total memory used for FTS cache is exhausted, and we will

need a sync to free some memory

Definition at line 53 of file fts0fts.cc.

UNIV_INTERN ulong fts_result_cache_limit
This is FTS result cache limit for each query and would be

a configurable variable

Definition at line 60 of file fts0fts.cc.

const ulint UTF8_ERROR = 0xFFFFFFFF

Error condition reported by fts_utf8_decode()

Definition at line 74 of file fts0fts.cc.