34#ifndef INNOBASE_FTS0PRIV_H
35#define INNOBASE_FTS0PRIV_H
67#define FTS_BACKGROUND_THREAD_WAIT_COUNT 1000
70#define FTS_MAX_CONFIG_NAME_LEN 64
73#define FTS_MAX_CONFIG_VALUE_LEN 1024
76#define FTS_ILIST_MAX_SIZE (64 * 1024)
81#define FTS_OPTIMIZE_LIMIT_IN_SECS "optimize_checkpoint_limit"
84#define FTS_SYNCED_DOC_ID "synced_doc_id"
87#define FTS_LAST_OPTIMIZED_WORD "last_optimized_word"
91#define FTS_TOTAL_DELETED_COUNT "deleted_doc_count"
94#define FTS_TOTAL_WORD_COUNT "total_word_count"
97#define FTS_OPTIMIZE_START_TIME "optimize_start_time"
100#define FTS_OPTIMIZE_END_TIME "optimize_end_time"
103#define FTS_STOPWORD_TABLE_NAME "stopword_table_name"
106#define FTS_USE_STOPWORD "use_stopword"
110#define FTS_TABLE_STATE "table_state"
120#define FTS_AUX_MIN_TABLE_ID_LENGTH 48
123#define FTS_MAX_INT_LEN 32
173#define FTS_FETCH_DOC_BY_ID_EQUAL 1
174#define FTS_FETCH_DOC_BY_ID_LARGE 2
314#ifdef FTS_OPTIMIZE_DEBUG
317[[nodiscard]]
dberr_t fts_config_get_index_ulint(
325[[nodiscard]]
dberr_t fts_config_set_index_ulint(
dberr_t
Definition: db0err.h:39
uint64_t doc_id_t
Document id type.
Definition: fts0fts.h:79
const char * fts_get_select_columns_str(dict_index_t *index, pars_info_t *info, mem_heap_t *heap)
Construct the column specification part of the SQL string for selecting the indexed FTS columns for t...
Definition: fts0sql.cc:277
static int fts_trx_table_cmp(const void *v1, const void *v2)
Compare two fts_trx_table_t instances, we actually compare the table id's here.
dberr_t fts_config_get_index_value(trx_t *trx, dict_index_t *index, const char *param, fts_string_t *value)
Get value specific to an FTS index from the config table.
Definition: fts0config.cc:152
enum fts_table_state_enum fts_table_state_t
Definition: fts0priv.h:61
void fts_doc_free(fts_doc_t *doc)
Free document.
Definition: fts0fts.cc:3289
dberr_t fts_sql_rollback(trx_t *trx)
Rollback a transaction.
Definition: fts0sql.cc:317
fts_index_cache_t * fts_find_index_cache(const fts_cache_t *cache, const dict_index_t *index)
Search the index specific cache for a particular FTS index.
Definition: fts0fts.cc:5249
dberr_t fts_doc_fetch_by_doc_id(fts_get_doc_t *get_doc, doc_id_t doc_id, dict_index_t *index_to_use, ulint option, fts_sql_callback callback, void *arg)
Fetch document (= a single row's indexed text) with the given document id.
Definition: fts0fts.cc:3843
constexpr std::chrono::milliseconds FTS_MAX_BACKGROUND_THREAD_WAIT
The default time to wait for the background thread.
Definition: fts0priv.h:64
que_t * fts_parse_sql(fts_table_t *fts_table, pars_info_t *info, const char *sql)
Parse an SQL string.
Definition: fts0sql.cc:193
fts_table_state_enum
Definition: fts0priv.h:48
@ FTS_TABLE_STATE_OPTIMIZING
This is a substate of RUNNING.
Definition: fts0priv.h:55
@ FTS_TABLE_STATE_DELETED
All aux tables to be dropped when it's safe to do so.
Definition: fts0priv.h:57
@ FTS_TABLE_STATE_RUNNING
Auxiliary tables created OK.
Definition: fts0priv.h:53
dberr_t fts_config_set_ulint(trx_t *trx, fts_table_t *fts_table, const char *name, ulint int_value)
Set an ulint value in the config table.
Definition: fts0config.cc:367
dberr_t fts_config_get_value(trx_t *trx, fts_table_t *fts_table, const char *name, fts_string_t *value)
Get value from config table.
Definition: fts0config.cc:71
static int fts_trx_table_id_cmp(const void *p1, const void *p2)
Compare a table id with a trx_table_t table id.
int fts_bsearch(fts_update_t *array, int lower, int upper, doc_id_t doc_id)
Do a binary search for a doc id in the array.
Definition: fts0opt.cc:1051
dberr_t fts_index_fetch_nodes(trx_t *trx, que_t **graph, fts_table_t *fts_table, const fts_string_t *word, fts_fetch_t *fetch)
Read the rows from the FTS inde.
Definition: fts0opt.cc:486
void fts_optimize_add_table(dict_table_t *table)
Add the table to add to the OPTIMIZER's list.
Definition: fts0opt.cc:2498
dberr_t fts_write_node(trx_t *trx, que_t **graph, fts_table_t *fts_table, fts_string_t *word, fts_node_t *node)
in: node columns
Definition: fts0fts.cc:3963
dberr_t fts_sql_commit(trx_t *trx)
Commit a transaction.
Definition: fts0sql.cc:303
dberr_t fts_config_set_index_value(trx_t *trx, dict_index_t *index, const char *param, fts_string_t *value)
Set the value specific to an FTS index in the config table.
Definition: fts0config.cc:244
static int fts_write_object_id(ib_id_t id, char *str)
Write the table id to the given buffer (including final NUL).
dberr_t fts_config_set_value(trx_t *trx, fts_table_t *fts_table, const char *name, const fts_string_t *value)
Set the value in the config table for name.
Definition: fts0config.cc:178
bool fts_query_expansion_fetch_doc(void *row, void *user_arg)
Callback function for fetch that stores the text of an FTS document, converting each column to UTF-16...
Definition: fts0fts.cc:3305
char * fts_get_table_name_prefix(const fts_table_t *fts_table)
Construct the prefix name of an FTS table.
Definition: fts0sql.cc:135
void fts_cache_node_add_positions(fts_cache_t *cache, fts_node_t *node, doc_id_t doc_id, ib_vector_t *positions)
Add node positions.
Definition: fts0fts.cc:1060
bool fts_wait_for_background_thread_to_start(dict_table_t *table, std::chrono::microseconds max_wait)
Wait for the background thread to start.
Definition: fts0fts.cc:5310
void fts_doc_init(fts_doc_t *doc)
Initialize a document.
Definition: fts0fts.cc:3279
void fts_get_table_name(const fts_table_t *fts_table, char *table_name)
Construct the name of an ancillary FTS table for the given table.
Definition: fts0sql.cc:174
bool fts_check_token(const fts_string_t *token, const ib_rbt_t *stopwords, bool is_ngram, const CHARSET_INFO *cs)
Check fts token.
Definition: fts0fts.cc:4511
int fts_get_table_id(const fts_table_t *fts_table, char *table_id)
Get the table id.
Definition: fts0sql.cc:60
void fts_word_free(fts_word_t *word)
Free fts_optimizer_word_t instanace.
Definition: fts0opt.cc:1495
static bool fts_read_object_id(ib_id_t *id, const char *str)
Read the table id from the string generated by fts_write_object_id().
void fts_get_table_name_5_7(const fts_table_t *fts_table, char *table_name)
Construct the name of an ancillary FTS table for the given table in 5.7 compatible format.
Definition: fts0sql.cc:187
char * fts_config_create_index_param_name(const char *param, const dict_index_t *index)
Create the config table name for retrieving index specific value.
Definition: fts0config.cc:127
dberr_t fts_config_get_ulint(trx_t *trx, fts_table_t *fts_table, const char *name, ulint *int_value)
Get an ulint value from the config table.
Definition: fts0config.cc:336
const ib_vector_t * fts_cache_find_word(const fts_index_cache_t *index_cache, const fts_string_t *text)
Search cache for word.
Definition: fts0fts.cc:5261
void fts_cache_append_deleted_doc_ids(const fts_cache_t *cache, ib_vector_t *vector)
Append deleted doc ids to vector and sort the vector.
Definition: fts0fts.cc:5287
dberr_t fts_eval_sql(trx_t *trx, que_t *graph)
Evaluate a parsed SQL statement.
Definition: fts0sql.cc:249
Full text search internal header file.
Full text search types file.
pars_user_func_cb_t fts_sql_callback
Callbacks used within FTS.
Definition: fts0types.h:49
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: commit_order_queue.h:34
static std::string lower(std::string_view str)
Definition: config_parser.cc:65
const char * table_name
Definition: rules_table_service.cc:56
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2876
Query graph global types.
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
Data structure for an index.
Definition: dict0mem.h:1041
Data structure for a database table.
Definition: dict0mem.h:1904
The cache for the FTS system.
Definition: fts0types.h:146
This type represents a single document field.
Definition: fts0types.h:274
Callback for reading and filtering nodes that are read from FTS index.
Definition: fts0types.h:253
It's main purpose is to store the SQL prepared statements that are required to retrieve a document fr...
Definition: fts0types.h:63
Since we can have multiple FTS indexes on a table, we keep a per index cache of words etc.
Definition: fts0types.h:73
Columns of the FTS auxiliary INDEX table.
Definition: fts0types.h:213
An UTF-16 ro UTF-8 string.
Definition: fts0fts.h:294
This is used to generate the FTS auxiliary table name, we need the table id and the index id to gener...
Definition: fts0fts.h:326
For supporting the tracking of updates on multiple FTS indexes we need to track which FTS indexes nee...
Definition: fts0types.h:95
Word text plus it's array of nodes as on disk in FTS index.
Definition: fts0types.h:245
Red black tree instance.
Definition: ut0rbt.h:72
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Extra information supplied for pars_sql().
Definition: pars0pars.h:452
Definition: que0que.h:301
Definition: trx0trx.h:675
Version control for database, common definitions, and include files.
uint64_t ib_id_t
The generic InnoDB system object identifier data type.
Definition: univ.i:443
unsigned long int ulint
Definition: univ.i:406