/* The various states of the FTS sub system pertaining to a table with
FTS indexes defined on it. */ enum fts_table_state_enum { /* !<This must be 0 since we insert ahardcoded'0'atcreatetime
to the config table */
FTS_TABLE_STATE_RUNNING = 0, /*!< Auxiliary tables created OK */
FTS_TABLE_STATE_OPTIMIZING, /*!< This is a substate of RUNNING */
FTS_TABLE_STATE_DELETED /*!< All aux tables to be dropped when
it's safe to do so */
};
/** The default time to wait for the background thread (in microseconds). */ #define FTS_MAX_BACKGROUND_THREAD_WAIT 10000
/** Maximum number of iterations to wait before we complain */ #define FTS_BACKGROUND_THREAD_WAIT_COUNT 1000
/** The maximum length of the config table's value column in bytes */ #define FTS_MAX_CONFIG_NAME_LEN 64
/** The maximum length of the config table's value column in bytes */ #define FTS_MAX_CONFIG_VALUE_LEN 1024
/** Approx. upper limit of ilist length in bytes. */ #define FTS_ILIST_MAX_SIZE (64 * 1024)
/** FTS config table name parameters */
/** The number of seconds after which an OPTIMIZE run will stop */ #define FTS_OPTIMIZE_LIMIT_IN_SECS "optimize_checkpoint_limit"
/** The next doc id */ #define FTS_SYNCED_DOC_ID "synced_doc_id"
/** The last word that was OPTIMIZED */ #define FTS_LAST_OPTIMIZED_WORD "last_optimized_word"
/** Total number of documents that have been deleted. The next_doc_id
minus this count gives us the total number of documents. */ #define FTS_TOTAL_DELETED_COUNT "deleted_doc_count"
/** Total number of words parsed from all documents */ #define FTS_TOTAL_WORD_COUNT "total_word_count"
/** User specified stopword table name */ #define FTS_STOPWORD_TABLE_NAME "stopword_table_name"
/** Whether to use (turn on/off) stopword */ #define FTS_USE_STOPWORD "use_stopword"
/** State of the FTS system for this table. It can be one of
RUNNING, OPTIMIZING, DELETED. */ #define FTS_TABLE_STATE "table_state"
/** The minimum length of an FTS auxiliary table names's id component e.g.,Foranauxiliarytablename
/** Maximum length of an integer stored in the config table value column. */ #define FTS_MAX_INT_LEN 32
/** Construct the name of an internal FTS table for the given table. @param[in]fts_tablemetadataonfulltext-indexedtable @param[out]table_nameanameuptoMAX_FULL_NAME_LEN
@param[in] dict_locked whether dict_sys.latch is being held */ void fts_get_table_name(const fts_table_t* fts_table, char* table_name, bool dict_locked = false)
MY_ATTRIBUTE((nonnull));
/** Write out a single word's data as new entry/entries in the INDEX table. @paramexecutorFTSQueryExecutor @paramselectedauxiliaryindexnumber @paramaux_dataauxiliarytabledata
@return DB_SUCCESS if all OK or error code */
dberr_t fts_write_node(FTSQueryExecutor *executor, uint8_t selected, const fts_aux_data_t *aux_data) noexcept
MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Check if a fts token is a stopword or less than fts_min_token_size orgreaterthanfts_max_token_size. @param[in]tokentokenstring @param[in]stopwordsstopwordsrbtree @param[in]cstokencharset @retvaltrueifitisnotstopwordandlengthinrange
@retval false if it is stopword or length not in range */ bool
fts_check_token( const fts_string_t* token, const ib_rbt_t* stopwords, const CHARSET_INFO* cs);
/******************************************************************//**
Initialize a document. */ void
fts_doc_init( /*=========*/
fts_doc_t* doc) /*!< in: doc to initialize */
MY_ATTRIBUTE((nonnull));
/******************************************************************//** Do a binary search for a doc id in the array
@return +ve index if found -ve index where it should be
inserted ifnot found */ int
fts_bsearch( /*========*/
doc_id_t* array, /*!< in: array to sort */ int lower, /*!< in: lower bound of array*/ int upper, /*!< in: upper bound of array*/
doc_id_t doc_id) /*!< in: doc id to lookup */
MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//**
Free document. */ void
fts_doc_free( /*=========*/
fts_doc_t* doc) /*!< in: document */
MY_ATTRIBUTE((nonnull)); /******************************************************************//**
Free fts_optimizer_word_t instanace.*/ void
fts_word_free( /*==========*/
fts_word_t* word) /*!< in: instance to free.*/
MY_ATTRIBUTE((nonnull));
/** Read the rows from FTS index @paramtrxtransaction @paramindexfulltextindex @paramwordwordtofetch @paramuser_arguserargument @paramprocessorcustomprocessortofilterthewordfromrecord @paramcompare_modecomparisonmodeforrecordmatching
@return error code or DB_SUCCESS */
dberr_t fts_index_fetch_nodes(FTSQueryExecutor *executor, dict_index_t *index, const fts_string_t *word, void *user_arg,
FTSRecordProcessor processor,
AuxCompareMode compare_mode) noexcept
MY_ATTRIBUTE((nonnull));
/** Get value from the config table. The caller must ensure that enough spaceisallocatedforvaluetoholdthecolumncontents. @paramtrxtransaction @paramtableIndexedftstable @paramnamenameofthekey @paramvaluevalueofthekey
@return DB_SUCCESS or error code */
dberr_t fts_config_get_value(FTSQueryExecutor *executor, const dict_table_t *table, constchar *name, fts_string_t *value) noexcept
MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get value specific to an FTS index from the config table. The caller
must ensure that enough space is allocated for value to hold the
column contents.
@return DB_SUCCESS or error code */
dberr_t
fts_config_get_index_value( /*=======================*/
FTSQueryExecutor* executor, /*!< in: query executor */
dict_index_t* index, /*!< in: index */ constchar* param, /*!< in: get config value for
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
noexcept MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//**
Set the value in the config table for name.
@return DB_SUCCESS or error code */
dberr_t
fts_config_set_value( /*=================*/
FTSQueryExecutor* executor, /*!< in: query executor */ const dict_table_t* table, /*!< in: the indexed FTS table */ constchar* name, /*!< in: get config value for
this parameter name */ const fts_string_t*
value) /*!< in: value to update */
noexcept MY_ATTRIBUTE((nonnull)); /****************************************************************//**
Set an ulint value in the config table.
@return DB_SUCCESS if all OK else error code */
dberr_t
fts_config_set_ulint( /*=================*/
FTSQueryExecutor* executor, /*!< in: query executor */ const dict_table_t* table, /*!< in: the indexed FTS table */ constchar* name, /*!< in: param name */
ulint int_value)noexcept /*!< in: value */
MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//**
Set the value specific to an FTS index in the config table.
@return DB_SUCCESS or error code */
dberr_t
fts_config_set_index_value( /*=======================*/
FTSQueryExecutor* executor, /*!< in: query executor */
dict_index_t* index, /*!< in: index */ constchar* param, /*!< in: get config value for
this parameter name */
fts_string_t* value)noexcept /*!< out: value read from
config table */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Search cache for word.
@return the word node vector if found else NULL */ const ib_vector_t*
fts_cache_find_word( /*================*/ const fts_index_cache_t*
index_cache, /*!< in: cache to search */ const fts_string_t*
text) /*!< in: word to search for */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Append deleted doc ids to vector and sort the vector. */ void
fts_cache_append_deleted_doc_ids( /*=============================*/
fts_cache_t* cache, /*!< in: cache to use */
ib_vector_t* vector); /*!< in: append to this vector */ /******************************************************************//**
Search the index specific cache for a particular FTS index.
@return the index specific cache else NULL */
fts_index_cache_t*
fts_find_index_cache( /*================*/ const fts_cache_t*
cache, /*!< in: cache to search */ const dict_index_t*
index) /*!< in: index to search for */
MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//**
Write the table id to the given buffer (including override final NUL). Buffer must be
at least FTS_AUX_MIN_TABLE_ID_LENGTH bytes long.
@return number of bytes written */
UNIV_INLINE int
fts_write_object_id( /*================*/
ib_id_t id, /*!< in: a table/index id */ char* str, /*!< in: buffer to write the id to */
size_t str_size); /*!< in: size of buffer */ /******************************************************************//**
Read the table id from the string generated by fts_write_object_id().
@returnTRUEif parse successful */
UNIV_INLINE
ibool
fts_read_object_id( /*===============*/
ib_id_t* id, /*!< out: a table id */ constchar* str) /*!< in: buffer to read from */
MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//**
Get the table id.
@return number of bytes written */ int
fts_get_table_id( /*=============*/ const fts_table_t*
fts_table, /*!< in: FTS Auxiliary table */ char* table_id) /*!< out: table id, must be at least FTS_AUX_MIN_TABLE_ID_LENGTHbytes
long */
MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//**
Add node positions. */ void
fts_cache_node_add_positions( /*=========================*/
fts_cache_t* cache, /*!< in: cache */
fts_node_t* node, /*!< in: word node */
doc_id_t doc_id, /*!< in: doc id */
ib_vector_t* positions) /*!< in: fts_token_t::positions */
MY_ATTRIBUTE((nonnull(2,4)));
/******************************************************************//**
Create the config table name for retrieving index specific value.
@return index config parameter name */ char*
fts_config_create_index_param_name( /*===============================*/ constchar* param, /*!< in: base name of param */ const dict_index_t* index) /*!< in: index for config */
MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
#include"fts0priv.inl"
#endif/* INNOBASE_FTS0PRIV_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.