|
InnoDB Plugin
1.0
|
#include "univ.i"#include "data0type.h"#include "data0types.h"#include "dict0types.h"#include "hash0hash.h"#include "mem0mem.h"#include "rem0types.h"#include "row0types.h"#include "trx0types.h"#include "ut0vec.h"#include "ut0rbt.h"#include "ut0wqueue.h"#include "que0types.h"#include "ft_global.h"

Go to the source code of this file.
Data Structures | |
| struct | fts_trx_t |
| struct | fts_savepoint_t |
| struct | fts_trx_table_t |
| struct | fts_trx_row_t |
| struct | fts_doc_ids_t |
| struct | fts_string_t |
| struct | fts_ranking_t |
| struct | fts_result_t |
| struct | fts_table_t |
| struct | fts_t |
Macros | |
| #define | FTS_NULL_DOC_ID 0 |
| #define | FTS_DOC_ID_COL_NAME "FTS_DOC_ID" |
| #define | FTS_DOC_ID_INDEX_NAME "FTS_DOC_ID_INDEX" |
| #define | FTS_DOC_ID_INDEX_NAME_LEN 16 |
| #define | FTS_DOC_ID_LEN 8 |
| #define | FTS_NUM_FIELDS_SORT 3 |
| #define | MAX_DOC_ID_OPT_VAL 1073741824 |
| #define | FTS_DOC_ID_FORMAT IB_ID_FMT |
| #define | fts_write_doc_id(d, s) mach_write_to_8(d, s) |
| #define | fts_read_doc_id(s) mach_read_from_8(s) |
| #define | fts_bind_doc_id(i, n, v) pars_info_bind_int8_literal(i, n, v) |
| #define | FTS_NL 0 |
| #define | FTS_BOOL 1 |
| #define | FTS_SORTED 2 |
| #define | FTS_EXPAND 4 |
| #define | FTS_PROXIMITY 8 |
| #define | FTS_PHRASE 16 |
| #define | FTS_OPT_RANKING 32 |
| #define | FTS_INDEX_TABLE_IND_NAME "FTS_INDEX_TABLE_IND" |
| #define | FTS_OPTIMIZE_THRESHOLD 10000000 |
| #define | FTS_DOC_ID_MAX_STEP 10000 |
| #define | FTS_INIT_FTS_TABLE(fts_table, m_suffix, m_type, m_table) |
| #define | FTS_INIT_INDEX_TABLE(fts_table, m_suffix, m_type, m_index) |
| #define | STOPWORD_NOT_INIT 0x1 |
| #define | STOPWORD_OFF 0x2 |
| #define | STOPWORD_FROM_DEFAULT 0x4 |
| #define | STOPWORD_USER_TABLE 0x8 |
| #define | FTS_MAX_WORD_LEN HA_FT_MAXBYTELEN |
| #define | FTS_MAX_WORD_LEN_IN_CHAR HA_FT_MAXCHARLEN |
| #define | fts_que_graph_free(graph) |
Typedefs | |
| typedef ib_uint64_t | doc_id_t |
| typedef float | fts_rank_t |
| typedef unsigned short | ib_uc_t |
| typedef enum fts_status | fts_status_t |
Enumerations | |
| enum | fts_row_state { FTS_INSERT = 0, FTS_MODIFY, FTS_DELETE, FTS_NOTHING, FTS_INVALID } |
| enum | fts_table_type_t { FTS_INDEX_TABLE, FTS_COMMON_TABLE } |
| enum | fts_status { BG_THREAD_STOP = 1, BG_THREAD_READY = 2, ADD_THREAD_STARTED = 4, ADDED_TABLE_SYNCED = 8, TABLE_DICT_LOCKED = 16 } |
Functions | |
| UNIV_INTERN fts_cache_t * | fts_cache_create (dict_table_t *table) |
| UNIV_INTERN fts_index_cache_t * | fts_cache_index_cache_create (dict_table_t *table, dict_index_t *index) |
| UNIV_INTERN dberr_t | fts_get_next_doc_id (const dict_table_t *table, doc_id_t *doc_id)) |
| UNIV_INTERN void | fts_update_next_doc_id (trx_t *trx, const dict_table_t *table, const char *table_name, doc_id_t doc_id))) |
| UNIV_INTERN dberr_t | fts_create_doc_id (dict_table_t *table, dtuple_t *row, mem_heap_t *heap)) |
| UNIV_INTERN fts_doc_ids_t * | fts_doc_ids_create (void) |
| UNIV_INTERN void | fts_doc_ids_free (fts_doc_ids_t *doc_ids) |
| UNIV_INTERN void | fts_trx_add_op (trx_t *trx, dict_table_t *table, doc_id_t doc_id, fts_row_state state, ib_vector_t *fts_indexes))) |
| UNIV_INTERN void | fts_trx_free (fts_trx_t *fts_trx) |
| UNIV_INTERN dberr_t | fts_create_common_tables (trx_t *trx, const dict_table_t *table, const char *name, bool skip_doc_id_index)) |
| UNIV_INTERN dberr_t | fts_create_index_tables (trx_t *trx, const dict_index_t *index)) |
| UNIV_INTERN dberr_t | fts_create_index_tables_low (trx_t *trx, const dict_index_t *index, const char *table_name, table_id_t table_id)) |
| UNIV_INTERN void | fts_add_doc_id_column (dict_table_t *table, mem_heap_t *heap))) |
| UNIV_INTERN dberr_t | fts_drop_tables (trx_t *trx, dict_table_t *table)) |
| UNIV_INTERN dberr_t | fts_commit (trx_t *trx)) |
| UNIV_INTERN dberr_t | fts_query (trx_t *trx, dict_index_t *index, uint flags, const byte *query, ulint query_len, fts_result_t **result)) |
| UNIV_INTERN float | fts_retrieve_ranking (fts_result_t *result, doc_id_t doc_id) |
| UNIV_INTERN void | fts_query_sort_result_on_rank (fts_result_t *result) |
| UNIV_INTERN void | fts_query_free_result (fts_result_t *result) |
| UNIV_INTERN doc_id_t | fts_get_doc_id_from_row (dict_table_t *table, dtuple_t *row) |
| UNIV_INTERN doc_id_t | fts_get_doc_id_from_rec (dict_table_t *table, const rec_t *rec, mem_heap_t *heap) |
| UNIV_INTERN doc_id_t | fts_update_doc_id (dict_table_t *table, upd_field_t *ufield, doc_id_t *next_doc_id) |
| UNIV_INTERN void | fts_startup (void) |
| UNIV_INTERN void | fts_start_shutdown (dict_table_t *table, fts_t *fts) |
| UNIV_INTERN void | fts_shutdown (dict_table_t *table, fts_t *fts) |
| UNIV_INTERN fts_t * | fts_create (dict_table_t *table) |
| UNIV_INTERN void | fts_free (dict_table_t *table) |
| UNIV_INTERN dberr_t | fts_optimize_table (dict_table_t *table)) |
| UNIV_INTERN void | fts_optimize_init (void) |
| UNIV_INTERN ibool | fts_optimize_is_init (void) |
| UNIV_INTERN dberr_t | fts_drop_index_tables (trx_t *trx, dict_index_t *index)) |
| UNIV_INTERN void | fts_optimize_remove_table (dict_table_t *table) |
| UNIV_INTERN void | fts_optimize_start_shutdown (void) |
| UNIV_INTERN void | fts_optimize_end (void) |
| UNIV_INTERN void | fts_savepoint_take (trx_t *trx, fts_trx_t *fts_trx, const char *name)) |
| UNIV_INTERN void | fts_savepoint_laststmt_refresh (trx_t *trx)) |
| UNIV_INTERN void | fts_savepoint_release (trx_t *trx, const char *name) |
| UNIV_INTERN void | fts_cache_destroy (fts_cache_t *cache) |
| UNIV_INTERN void | fts_cache_clear (fts_cache_t *cache) |
| UNIV_INTERN void | fts_cache_init (fts_cache_t *cache) |
| UNIV_INTERN void | fts_savepoint_rollback (trx_t *trx, const char *name) |
| UNIV_INTERN void | fts_savepoint_rollback_last_stmt (trx_t *trx) |
| UNIV_INTERN void | fts_drop_orphaned_tables (void) |
| UNIV_INTERN dberr_t | fts_drop_index_split_tables (trx_t *trx, dict_index_t *index)) |
| UNIV_INTERN dberr_t | fts_sync_table (dict_table_t *table)) |
| 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_INFO * | fts_index_get_charset (dict_index_t *index) |
| UNIV_INTERN doc_id_t | fts_init_doc_id (const dict_table_t *table) |
| int | innobase_fts_text_cmp (const void *cs, const void *p1, const void *p2) |
| size_t | innobase_fts_casedn_str (CHARSET_INFO *cs, char *src, size_t src_len, char *dst, size_t dst_len) |
| int | innobase_fts_text_cmp_prefix (const void *cs, const void *p1, const void *p2) |
| ulint | innobase_mysql_fts_get_token (CHARSET_INFO *charset, const byte *start, const byte *end, fts_string_t *token, ulint *offset) |
| UNIV_INTERN ulint | fts_get_rows_count (fts_table_t *fts_table) |
| UNIV_INTERN doc_id_t | fts_get_max_doc_id (dict_table_t *table) |
| UNIV_INTERN CHARSET_INFO * | fts_valid_stopword_table (const char *stopword_table_name) |
| UNIV_INTERN ibool | fts_load_stopword (const dict_table_t *table, trx_t *trx, const char *global_stopword_table, const char *session_stopword_table, ibool stopword_is_on, ibool reload) |
| UNIV_INTERN ib_vector_t * | fts_get_docs_create (fts_cache_t *cache) |
| UNIV_INTERN dberr_t | fts_table_fetch_doc_ids (trx_t *trx, fts_table_t *fts_table, fts_doc_ids_t *doc_ids) |
| UNIV_INTERN ibool | fts_init_index (dict_table_t *table, ibool has_cache_lock) |
| UNIV_INTERN void | fts_add_index (dict_index_t *index, dict_table_t *table) |
| UNIV_INTERN dberr_t | fts_drop_index (dict_table_t *table, dict_index_t *index, trx_t *trx)) |
| dberr_t | fts_rename_aux_tables (dict_table_t *table, const char *new_name, trx_t *trx) |
| UNIV_INTERN ibool | fts_check_cached_index (dict_table_t *table) |
Variables | |
| ulong | fts_sort_pll_degree |
| ulong | fts_num_word_optimize |
| char | fts_enable_diag_print |
| const char * | fts_default_stopword [] |
| ulong | fts_max_cache_size |
| ulong | fts_max_total_cache_size |
| ulong | fts_result_cache_limit |
| ulong | fts_max_token_size |
| ulong | fts_min_token_size |
| bool | fts_need_sync |
| char * | fts_internal_tbl_name |
Full text search header file
Created 2011/09/02 Sunny Bains
| #define fts_bind_doc_id | ( | i, | |
| n, | |||
| v | |||
| ) | pars_info_bind_int8_literal(i, n, v) |
Bind the doc id to a variable
| #define FTS_DOC_ID_COL_NAME "FTS_DOC_ID" |
FTS hidden column that is used to map to and from the row
| #define FTS_DOC_ID_FORMAT IB_ID_FMT |
doc_id_t printf format
| #define FTS_DOC_ID_INDEX_NAME "FTS_DOC_ID_INDEX" |
The name of the index created by FTS
| #define FTS_DOC_ID_LEN 8 |
Doc ID is a 8 byte value
| #define FTS_INIT_FTS_TABLE | ( | fts_table, | |
| m_suffix, | |||
| m_type, | |||
| m_table | |||
| ) |
Initialize the "fts_table" for internal query into FTS auxiliary
tables
| #define FTS_INIT_INDEX_TABLE | ( | fts_table, | |
| m_suffix, | |||
| m_type, | |||
| m_index | |||
| ) |
| #define FTS_MAX_WORD_LEN HA_FT_MAXBYTELEN |
Maximum possible Fulltext word length
| #define FTS_MAX_WORD_LEN_IN_CHAR HA_FT_MAXCHARLEN |
Maximum possible Fulltext word length (in characters)
| #define FTS_NL 0 |
Defines for FTS query mode, they have the same values as
those defined in mysql file ft_global.h
| #define FTS_NULL_DOC_ID 0 |
"NULL" value of a document id.
| #define FTS_NUM_FIELDS_SORT 3 |
The number of fields to sort when we build FT index with
FIC. Three fields are sort: (word, doc_id, position)
| #define FTS_OPTIMIZE_THRESHOLD 10000000 |
Threshold where our optimize thread automatically kicks in
| #define fts_que_graph_free | ( | graph | ) |
| #define fts_read_doc_id | ( | s | ) | mach_read_from_8(s) |
Read a document id to internal format.
| #define fts_write_doc_id | ( | d, | |
| s | |||
| ) | mach_write_to_8(d, s) |
Convert document id to the InnoDB (BIG ENDIAN) storage format.
| #define MAX_DOC_ID_OPT_VAL 1073741824 |
Maximum number of rows in a table, smaller than which, we will
optimize using a 4 byte Doc ID for FIC merge sort to reduce sort size
| #define STOPWORD_NOT_INIT 0x1 |
status bits for fts_stopword_t status field.
| typedef ib_uint64_t doc_id_t |
Document id type.
| typedef float fts_rank_t |
FTS rank type, which will be between 0 .. 1 inclusive
| typedef unsigned short ib_uc_t |
Since MySQL's character set support for Unicode is woefully inadequate
(it supports basic operations like isalpha etc. only for 8-bit characters), we have to implement our own. We use UTF-16 without surrogate processing as our in-memory format. This typedef is a single such character.
| enum fts_row_state |
Type of a row during a transaction. FTS_NOTHING means the row can be
forgotten from the FTS system's POV, FTS_INVALID is an internal value used to mark invalid states.
NOTE: Do not change the order or value of these, fts_trx_row_get_new_state depends on them being exactly as they are.
| enum fts_status |
| enum fts_table_type_t |
| UNIV_INTERN void fts_add_doc_id_column | ( | dict_table_t * | table, |
| mem_heap_t * | heap | ||
| ) |
Add the FTS document id hidden column.
| table | in/out: Table with FTS index |
| heap | in: temporary memory heap, or NULL |
| UNIV_INTERN void fts_add_index | ( | dict_index_t * | index, |
| dict_table_t * | table | ||
| ) |
Add a newly create index in FTS cache table
| index | FTS index to be added |
| UNIV_INTERN void fts_cache_clear | ( | fts_cache_t * | cache | ) |
Clear cache. in: cache
| UNIV_INTERN fts_cache_t* fts_cache_create | ( | dict_table_t * | table | ) |
Create a FTS cache. table owns the FTS cache
| UNIV_INTERN void fts_cache_destroy | ( | fts_cache_t * | cache | ) |
Free the FTS cache. in: cache
| UNIV_INTERN fts_index_cache_t* fts_cache_index_cache_create | ( | dict_table_t * | table, |
| dict_index_t * | index | ||
| ) |
Create a FTS index cache.
| table | in: table with FTS index |
| UNIV_INTERN void fts_cache_init | ( | fts_cache_t * | cache | ) |
Initialize things in cache. in: cache
| 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
The given transaction is about to be committed; do whatever is necessary from the FTS system's POV.
| trx | in: transaction |
| UNIV_INTERN fts_t* fts_create | ( | dict_table_t * | table | ) |
| UNIV_INTERN dberr_t fts_create_common_tables | ( | trx_t * | trx, |
| const dict_table_t * | table, | ||
| const char * | name, | ||
| bool | skip_doc_id_index | ||
| ) |
Creates the common ancillary tables needed for supporting an FTS index on the given table. row_mysql_lock_data_dictionary must have been called before this.
| trx | in: transaction handle |
| table | in: table with one FTS index |
| name | in: table name |
| skip_doc_id_index | in: Skip index on doc id |
| UNIV_INTERN dberr_t fts_create_doc_id | ( | dict_table_t * | table, |
| dtuple_t * | row, | ||
| mem_heap_t * | heap | ||
| ) |
Create a new document id .
| table | in: row is of this table. |
| row | in/out: add doc id value to this row. This is the current row that is being inserted. |
| heap | in: heap |
| UNIV_INTERN dberr_t fts_create_index_tables | ( | trx_t * | trx, |
| const dict_index_t * | index | ||
| ) |
Wrapper function of fts_create_index_tables_low(), create auxiliary tables for an FTS index
| trx | in: transaction handle |
| index | in: the FTS index instance |
| UNIV_INTERN dberr_t fts_create_index_tables_low | ( | trx_t * | trx, |
| const dict_index_t * | index, | ||
| const char * | table_name, | ||
| table_id_t | table_id | ||
| ) |
Creates the column specific ancillary tables needed for supporting an FTS index on the given table. row_mysql_lock_data_dictionary must have been called before this.
| trx | in: transaction handle |
| index | in: the FTS index instance |
| table_name | in: the table name |
| table_id | in: the table id |
| UNIV_INTERN fts_doc_ids_t* fts_doc_ids_create | ( | void | ) |
Create a new fts_doc_ids_t.
| UNIV_INTERN void fts_doc_ids_free | ( | fts_doc_ids_t * | doc_ids | ) |
Free a fts_doc_ids_t. in: doc_ids to free
| 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
| table | in: Table where indexes are dropped |
| index | in: Index to be dropped |
| trx | in: Transaction for the drop |
| UNIV_INTERN dberr_t fts_drop_index_split_tables | ( | trx_t * | trx, |
| dict_index_t * | index | ||
| ) |
Since we do a horizontal split on the index table, we need to drop all the split tables.
| trx | in: transaction |
| index | in: fts instance |
| UNIV_INTERN dberr_t fts_drop_index_tables | ( | trx_t * | trx, |
| dict_index_t * | index | ||
| ) |
Drops index ancillary tables for a FTS index
| trx | in: transaction |
| index | in: Index to drop |
| UNIV_INTERN void fts_drop_orphaned_tables | ( | void | ) |
Drop all orphaned FTS auxiliary tables, those that don't have a parent table or FTS index defined on them.
| UNIV_INTERN dberr_t fts_drop_tables | ( | trx_t * | trx, |
| dict_table_t * | table | ||
| ) |
Drops the ancillary tables needed for supporting an FTS index on the given table. row_mysql_lock_data_dictionary must have been called before this.
| trx | in: transaction |
| table | in: table has the FTS index |
| UNIV_INTERN void fts_free | ( | dict_table_t * | table | ) |
Free the FTS resources. in/out: table with FTS indexes
| UNIV_INTERN doc_id_t fts_get_doc_id_from_rec | ( | dict_table_t * | table, |
| const rec_t * | rec, | ||
| mem_heap_t * | heap | ||
| ) |
Extract the doc id from the FTS hidden column. in: heap
| table | in: table |
| rec | in: rec |
| UNIV_INTERN doc_id_t fts_get_doc_id_from_row | ( | dict_table_t * | table, |
| dtuple_t * | row | ||
| ) |
Extract the doc id from the FTS hidden column. in: row whose FTS doc id we want to extract.
| table | in: table |
| UNIV_INTERN ib_vector_t* fts_get_docs_create | ( | fts_cache_t * | cache | ) |
Create the vector of fts_get_doc_t instances.
| UNIV_INTERN doc_id_t fts_get_max_doc_id | ( | dict_table_t * | table | ) |
Get maximum Doc ID in a table if index "FTS_DOC_ID_INDEX" exists
| UNIV_INTERN dberr_t fts_get_next_doc_id | ( | const dict_table_t * | table, |
| doc_id_t * | doc_id | ||
| ) |
Get the next available document id. This function creates a new transaction to generate the document id.
| table | in: table |
| doc_id | out: new document id |
| UNIV_INTERN ulint fts_get_rows_count | ( | fts_table_t * | fts_table | ) |
Fetch COUNT(*) from specified table.
| UNIV_INTERN CHARSET_INFO* fts_index_get_charset | ( | dict_index_t * | index | ) |
Create an FTS index cache. in: FTS index
| UNIV_INTERN doc_id_t fts_init_doc_id | ( | const dict_table_t * | table | ) |
Get the initial Doc ID by consulting the CONFIG table
| UNIV_INTERN ibool fts_init_index | ( | dict_table_t * | table, |
| ibool | has_cache_lock | ||
| ) |
This function brings FTS index in sync when FTS index is first used. There are documents that have not yet sync-ed to auxiliary tables from last server abnormally shutdown, we will need to bring such document into FTS cache before any further operations
| table | in: Table with FTS |
| UNIV_INTERN ibool fts_load_stopword | ( | const dict_table_t * | table, |
| trx_t * | trx, | ||
| const char * | global_stopword_table, | ||
| const char * | session_stopword_table, | ||
| ibool | stopword_is_on, | ||
| ibool | reload | ||
| ) |
This function loads specified stopword into FTS cache
| table | in: Table with FTS |
| trx | in: Transaction |
| global_stopword_table | in: Global stopword table name |
| session_stopword_table | in: Session stopword table name |
| stopword_is_on | in: Whether stopword option is turned on/off |
| UNIV_INTERN void fts_optimize_end | ( | void | ) |
Inform optimize to clean up.
| UNIV_INTERN void fts_optimize_init | ( | void | ) |
Startup the optimize thread and create the work queue.
| UNIV_INTERN ibool fts_optimize_is_init | ( | void | ) |
Check whether the work queue is initialized.
| UNIV_INTERN void fts_optimize_remove_table | ( | dict_table_t * | table | ) |
Remove the table from the OPTIMIZER's list. We do wait for acknowledgement from the consumer of the message. in: table to remove
| UNIV_INTERN void fts_optimize_start_shutdown | ( | void | ) |
Signal the optimize thread to prepare for shutdown.
| UNIV_INTERN dberr_t fts_optimize_table | ( | dict_table_t * | table | ) |
Run OPTIMIZE on the given table.
| table | in: table to optimiza |
| 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 in: query graph
| fts_table | in: FTS table |
| index_cache | in: FTS index cache |
| UNIV_INTERN dberr_t fts_query | ( | trx_t * | trx, |
| dict_index_t * | index, | ||
| uint | flags, | ||
| const byte * | query, | ||
| ulint | query_len, | ||
| fts_result_t ** | result | ||
| ) |
FTS Query entry point.
| trx | in: transaction |
| index | in: FTS index to search |
| flags | in: FTS search mode |
| query | in: FTS query |
| query_len | in: FTS query string len in bytes |
| result | out: query result, to be freed by the caller. |
| UNIV_INTERN void fts_query_free_result | ( | fts_result_t * | result | ) |
FTS Query free result, returned by fts_query(). in: result instance to free.
| UNIV_INTERN void fts_query_sort_result_on_rank | ( | fts_result_t * | result | ) |
FTS Query sort result, returned by fts_query() on fts_ranking_t::rank. out: result instance to sort.
| dberr_t fts_rename_aux_tables | ( | dict_table_t * | table, |
| const char * | new_name, | ||
| trx_t * | trx | ||
| ) |
Rename auxiliary tables for all fts index for a table
| table | in: user Table |
| new_name | in: new table name |
| UNIV_INTERN float fts_retrieve_ranking | ( | fts_result_t * | result, |
| doc_id_t | doc_id | ||
| ) |
Retrieve the FTS Relevance Ranking result for doc with doc_id
| result | in: FTS result structure |
| UNIV_INTERN void fts_savepoint_laststmt_refresh | ( | trx_t * | trx | ) |
Refresh last statement savepoint.
| trx | in: transaction |
| UNIV_INTERN void fts_savepoint_release | ( | trx_t * | trx, |
| const char * | name | ||
| ) |
Release the savepoint data identified by name. in: savepoint name
| trx | in: transaction |
| UNIV_INTERN void fts_savepoint_rollback | ( | trx_t * | trx, |
| const char * | name | ||
| ) |
Rollback to and including savepoint indentified by name. in: savepoint name
| trx | in: transaction |
| UNIV_INTERN void fts_savepoint_rollback_last_stmt | ( | trx_t * | trx | ) |
Rollback to and including savepoint indentified by name. in: transaction
Take a FTS savepoint.
| trx | in: transaction |
| fts_trx | in: fts transaction |
| name | in: savepoint name |
| UNIV_INTERN void fts_shutdown | ( | dict_table_t * | table, |
| fts_t * | fts | ||
| ) |
Wait for FTS threads to shutdown. in: fts instance to shutdown
| table | in: table with FTS indexes |
| UNIV_INTERN void fts_start_shutdown | ( | dict_table_t * | table, |
| fts_t * | fts | ||
| ) |
Signal FTS threads to initiate shutdown. in: fts instance to shutdown
| table | in: table with FTS indexes |
| UNIV_INTERN void fts_startup | ( | void | ) |
FTS initialize.
| UNIV_INTERN dberr_t fts_sync_table | ( | dict_table_t * | table | ) |
Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end.
| table | in: table |
| UNIV_INTERN dberr_t fts_table_fetch_doc_ids | ( | trx_t * | trx, |
| fts_table_t * | fts_table, | ||
| fts_doc_ids_t * | doc_ids | ||
| ) |
Read the rows from the FTS index
| trx | in: transaction |
| fts_table | in: aux table |
| UNIV_INTERN void fts_trx_add_op | ( | trx_t * | trx, |
| dict_table_t * | table, | ||
| doc_id_t | doc_id, | ||
| fts_row_state | state, | ||
| ib_vector_t * | fts_indexes | ||
| ) |
Notify the FTS system about an operation on an FTS-indexed table.
| trx | in: InnoDB transaction |
| table | in: table |
| doc_id | in: doc id |
| state | in: state of the row |
| fts_indexes | in: FTS indexes affected (NULL=all) |
| UNIV_INTERN void fts_trx_free | ( | fts_trx_t * | fts_trx | ) |
Free an FTS trx. in, own: FTS trx
| UNIV_INTERN doc_id_t fts_update_doc_id | ( | dict_table_t * | table, |
| upd_field_t * | ufield, | ||
| doc_id_t * | next_doc_id | ||
| ) |
Update the query graph with a new document id.
| table | in: table |
| ufield | out: update node |
| UNIV_INTERN void fts_update_next_doc_id | ( | trx_t * | trx, |
| const dict_table_t * | table, | ||
| const char * | table_name, | ||
| doc_id_t | doc_id | ||
| ) |
Update the next and last Doc ID in the CONFIG table to be the input "doc_id" value (+ 1). We would do so after each FTS index build or table truncate
| trx | in/out: transaction |
| table | in: table |
| table_name | in: table name, or NULL |
| doc_id | in: DOC ID to set |
| UNIV_INTERN CHARSET_INFO* fts_valid_stopword_table | ( | const char * | stopword_table_name | ) |
Check whether user supplied stopword table exists and is of the right format.
| size_t innobase_fts_casedn_str | ( | CHARSET_INFO * | cs, |
| char * | src, | ||
| size_t | src_len, | ||
| char * | dst, | ||
| size_t | dst_len | ||
| ) |
Makes all characters in a string lower case. in: buffer size
| cs | in: Character set |
| src | in: string to put in lower case |
| src_len | in: input string length |
| dst | in: buffer for result string |
| int innobase_fts_text_cmp | ( | const void * | cs, |
| const void * | p1, | ||
| const void * | p2 | ||
| ) |
compare two character string according to their charset. in: node
| cs | in: Character set |
| p1 | in: key |
| int innobase_fts_text_cmp_prefix | ( | const void * | cs, |
| const void * | p1, | ||
| const void * | p2 | ||
| ) |
compare two character string according to their charset. in: node
| cs | in: Character set |
| p1 | in: key |
| ulint innobase_mysql_fts_get_token | ( | CHARSET_INFO * | charset, |
| const byte * | start, | ||
| const byte * | end, | ||
| fts_string_t * | token, | ||
| ulint * | offset | ||
| ) |
Get the next token from the given string and store it in *token. out: offset to token, measured as characters from 'start'
| charset | in: Character set |
| start | in: start of text |
| end | in: one character past end of text |
| token | out: token's text |
| char fts_enable_diag_print |
Variable specifying whether we do additional FTS diagnostic printout
in the log
| char* fts_internal_tbl_name |
Variable specifying the table that has Fulltext index to display its
content through information schema table
| ulong fts_max_cache_size |
Variable specifying the maximum FTS cache size for each table
| ulong fts_max_token_size |
Variable specifying the maximum FTS max token size
| ulong fts_max_total_cache_size |
Variable specifying the total memory allocated for FTS cache
| ulong fts_min_token_size |
Variable specifying the minimum FTS max token size
| bool fts_need_sync |
Whether the total memory used for FTS cache is exhausted, and we will
need a sync to free some memory
| ulong fts_num_word_optimize |
Variable specifying the number of word to optimize for each optimize table
call
| ulong fts_result_cache_limit |
Variable specifying the FTS result cache limit for each query
| ulong fts_sort_pll_degree |
Variable specifying the FTS parallel sort degree
1.8.1.2