34#ifndef INNOBASE_FTS0TYPES_H
35#define INNOBASE_FTS0TYPES_H
147#ifndef UNIV_HOTBACKUP
Full text search header file.
uint64_t doc_id_t
Document id type.
Definition: fts0fts.h:79
const fts_index_selector_t fts_index_selector_5_7[]
It's defined in fts/fts0fts.c.
Definition: fts0fts.cc:158
static ulint fts_decode_vlc(byte **ptr)
Decode and return the integer that was encoded using our VLC scheme.
static ulint fts_encode_int(ulint val, byte *buf)
Encode an integer using our VLC scheme and return the length in bytes.
static void fts_string_dup(fts_string_t *dst, const fts_string_t *src, mem_heap_t *heap)
Duplicate a string.
static ulint fts_get_encoded_len(ulint val)
Return length of val if it were encoded using our VLC scheme.
static int fts_trx_row_doc_id_cmp(const void *p1, const void *p2)
Compare two fts_trx_row_t instances doc_ids.
const fts_index_selector_t fts_index_selector[]
It's defined in fts/fts0fts.c.
Definition: fts0fts.cc:153
void(* fts_filter)(void *, fts_node_t *, void *, ulint len)
Definition: fts0types.h:53
static const char * fts_get_suffix(ulint selected)
Get the selected FTS aux INDEX suffix.
static int fts_ranking_doc_id_cmp(const void *p1, const void *p2)
Compare two fts_ranking_t instances doc_ids.
static const char * fts_get_suffix_5_7(ulint selected)
Return the selected FTS aux index suffix in 5.7 compatible format.
static ulint fts_select_index(const CHARSET_INFO *cs, const byte *str, ulint len)
Select the FTS auxiliary index for the given character.
pars_user_func_cb_t fts_sql_callback
Callbacks used within FTS.
Definition: fts0types.h:49
static int fts_update_doc_id_cmp(const void *p1, const void *p2)
Compare two fts_update_t instances doc_ids.
Full text variable length integer encoding/decoding.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: buf0block_hint.cc:30
Definition: commit_order_queue.h:34
bool(* pars_user_func_cb_t)(void *arg, void *user_arg)
Type of the user functions.
Definition: pars0pars.h:50
Query graph global types.
Definition: m_ctype.h:423
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a database table.
Definition: dict0mem.h:1909
The cache for the FTS system.
Definition: fts0types.h:146
rw_lock_t lock
lock protecting all access to the memory buffer.
Definition: fts0types.h:148
fts_sync_t * sync
sync structure to sync data to disk
Definition: fts0types.h:180
ib_vector_t * get_docs
information required to read the document from the table.
Definition: fts0types.h:171
ib_alloc_t * sync_heap
The heap allocator, for indexes and deleted_doc_ids, ie.
Definition: fts0types.h:182
ulint deleted
Number of doc ids deleted since last optimized.
Definition: fts0types.h:200
uint64_t total_size_before_sync
total size of fts cache, when last SYNC request was sent
Definition: fts0types.h:178
rw_lock_t init_lock
lock used for the cache initialization, it has different SYNC level as above cache lock
Definition: fts0types.h:152
mem_heap_t * cache_heap
Cache Heap.
Definition: fts0types.h:209
ulint total_size
total size consumed by the ilist field of all nodes.
Definition: fts0types.h:175
doc_id_t first_doc_id
first doc id since this table was opened
Definition: fts0types.h:197
doc_id_t synced_doc_id
Doc ID sync-ed to CONFIG table.
Definition: fts0types.h:195
ulint added
Number of doc ids added since last optimized.
Definition: fts0types.h:204
ib_alloc_t * self_heap
This heap is the heap out of which an instance of the cache itself was created.
Definition: fts0types.h:187
ib_mutex_t deleted_lock
Lock covering deleted_doc_ids.
Definition: fts0types.h:159
ib_vector_t * deleted_doc_ids
Array of deleted doc ids, each element is of type fts_update_t.
Definition: fts0types.h:163
fts_stopword_t stopword_info
Cached stopwords for the FTS.
Definition: fts0types.h:208
ib_vector_t * indexes
We store the stats and inverted index for the individual FTS indexes in this vector.
Definition: fts0types.h:166
ib_mutex_t optimize_lock
Lock for OPTIMIZE.
Definition: fts0types.h:157
doc_id_t next_doc_id
Next doc id.
Definition: fts0types.h:193
ib_mutex_t doc_id_lock
Lock covering Doc ID.
Definition: fts0types.h:161
Statistics relevant to a particular document, used during retrieval.
Definition: fts0types.h:56
doc_id_t doc_id
Document id.
Definition: fts0types.h:57
ulint word_count
Total words in the document.
Definition: fts0types.h:58
This type represents a single document field.
Definition: fts0types.h:274
fts_string_t text
document text
Definition: fts0types.h:275
ib_alloc_t * self_heap
An instance of this type is allocated from this heap along with any objects that have the same lifesp...
Definition: fts0types.h:285
ib_rbt_t * tokens
This is filled when the document is tokenized.
Definition: fts0types.h:280
bool found
true if the document was found successfully in the database
Definition: fts0types.h:277
bool is_ngram
Whether it is a ngram parser.
Definition: fts0types.h:294
CHARSET_INFO * charset
Document's charset info.
Definition: fts0types.h:290
ib_rbt_t * stopwords
Stopwords.
Definition: fts0types.h:296
st_mysql_ftparser * parser
fts plugin parser
Definition: fts0types.h:292
Callback for reading and filtering nodes that are read from FTS index.
Definition: fts0types.h:253
void * read_arg
Arg for the sql_callback.
Definition: fts0types.h:254
fts_sql_callback read_record
Callback for reading index record.
Definition: fts0types.h:256
ulint total_memory
Total memory used.
Definition: fts0types.h:258
It's main purpose is to store the SQL prepared statements that are required to retrieve a document fr...
Definition: fts0types.h:63
fts_cache_t * cache
The parent cache.
Definition: fts0types.h:68
que_t * get_document_graph
Definition: fts0types.h:67
fts_index_cache_t * index_cache
The index cache instance.
Definition: fts0types.h:64
Since we can have multiple FTS indexes on a table, we keep a per index cache of words etc.
Definition: fts0types.h:73
que_t ** sel_graph
Select query graphs.
Definition: fts0types.h:88
que_t ** ins_graph
Insert query graphs.
Definition: fts0types.h:86
dict_index_t * index
The FTS index instance.
Definition: fts0types.h:74
ib_vector_t * doc_stats
Array of the fts_doc_stats_t contained in the memory buffer.
Definition: fts0types.h:79
ib_rbt_t * words
Nodes; indexed by fts_string_t*, cells are fts_tokenizer_word_t*.
Definition: fts0types.h:76
CHARSET_INFO * charset
charset
Definition: fts0types.h:89
For horizontally splitting an FTS auxiliary index.
Definition: fts0types.h:262
ulint value
Character value at which to split.
Definition: fts0types.h:263
const char * suffix
FTS aux index suffix.
Definition: fts0types.h:266
Columns of the FTS auxiliary INDEX table.
Definition: fts0types.h:213
bool synced
flag whether the node is synced
Definition: fts0types.h:233
ulint ilist_size_alloc
Allocated size of ilist in bytes.
Definition: fts0types.h:230
byte * ilist
Binary list of documents & word positions the token appears in.
Definition: fts0types.h:218
ulint doc_count
Number of doc ids in ilist.
Definition: fts0types.h:226
doc_id_t last_doc_id
Last document id in ilist.
Definition: fts0types.h:216
ulint ilist_size
Used size of ilist in bytes.
Definition: fts0types.h:228
doc_id_t first_doc_id
First document id in ilist.
Definition: fts0types.h:214
Stop word control infotmation.
Definition: fts0types.h:107
ulint status
Status of the stopword tree.
Definition: fts0types.h:108
CHARSET_INFO * charset
charset for stopword
Definition: fts0types.h:111
ib_rbt_t * cached_stopword
This stores all active stopwords.
Definition: fts0types.h:110
ib_alloc_t * heap
The memory allocator to use.
Definition: fts0types.h:109
An UTF-16 ro UTF-8 string.
Definition: fts0fts.h:294
The SYNC state of the cache.
Definition: fts0types.h:116
bool unlock_cache
flag whether unlock cache when write fts node
Definition: fts0types.h:138
ulint upper_index
max index of the doc id vector to add to the FTS cache
Definition: fts0types.h:126
bool interrupted
true if SYNC was interrupted
Definition: fts0types.h:128
ulint max_cache_size
Max size in bytes of the cache.
Definition: fts0types.h:120
std::chrono::steady_clock::time_point start_time
SYNC start time.
Definition: fts0types.h:135
doc_id_t min_doc_id
The smallest doc id added to the cache.
Definition: fts0types.h:129
dict_table_t * table
Table with FTS index(es)
Definition: fts0types.h:119
doc_id_t max_doc_id
The doc id at which the cache was noted as being full, we use this to set the upper_limit field.
Definition: fts0types.h:132
os_event_t event
sync finish event
Definition: fts0types.h:140
ulint lower_index
the start index of the doc id vector from where to start adding documents to the FTS cache
Definition: fts0types.h:123
bool in_progress
flag whether sync is in progress.
Definition: fts0types.h:137
trx_t * trx
The transaction used for SYNCing the cache to disk.
Definition: fts0types.h:117
bool cache_full
flag, when true it indicates that we need to sync the cache to disk
Definition: fts0types.h:121
A token and its positions within a document.
Definition: fts0types.h:300
fts_string_t text
token text
Definition: fts0types.h:301
ib_vector_t * positions
an array of the positions the token is found in; each item is actually an ulint.
Definition: fts0types.h:303
A tokenizer word.
Definition: fts0types.h:237
ib_vector_t * nodes
Word node ilists, each element is of type fts_node_t.
Definition: fts0types.h:240
fts_string_t text
Token text.
Definition: fts0types.h:238
For supporting the tracking of updates on multiple FTS indexes we need to track which FTS indexes nee...
Definition: fts0types.h:95
ib_vector_t * fts_indexes
The FTS indexes that need to be updated.
Definition: fts0types.h:98
doc_id_t doc_id
The doc id affected.
Definition: fts0types.h:96
Word text plus it's array of nodes as on disk in FTS index.
Definition: fts0types.h:245
ib_alloc_t * heap_alloc
For handling all allocations.
Definition: fts0types.h:249
fts_string_t text
Word value in UTF-8.
Definition: fts0types.h:246
ib_vector_t * nodes
Nodes read from disk.
Definition: fts0types.h:247
Red black tree instance.
Definition: ut0rbt.h:72
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
InnoDB condition variable.
Definition: os0event.cc:63
Definition: que0que.h:301
The structure used in the spin lock implementation of a read-write lock.
Definition: sync0rw.h:363
Definition: plugin_ftparser.h:216
Definition: trx0trx.h:684
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406
Utilities for byte operations.