34#ifndef INNOBASE_FTS0TYPES_H
35#define INNOBASE_FTS0TYPES_H
145#ifndef UNIV_HOTBACKUP
Full text search header file.
uint64_t doc_id_t
Document id type.
Definition: fts0fts.h:77
const fts_index_selector_t fts_index_selector_5_7[]
It's defined in fts/fts0fts.c.
Definition: fts0fts.cc:156
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:151
void(* fts_filter)(void *, fts_node_t *, void *, ulint len)
Definition: fts0types.h:51
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:47
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:1052
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:385
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:144
rw_lock_t lock
lock protecting all access to the memory buffer.
Definition: fts0types.h:146
fts_sync_t * sync
sync structure to sync data to disk
Definition: fts0types.h:178
ib_vector_t * get_docs
information required to read the document from the table.
Definition: fts0types.h:169
ib_alloc_t * sync_heap
The heap allocator, for indexes and deleted_doc_ids, ie.
Definition: fts0types.h:180
ulint deleted
Number of doc ids deleted since last optimized.
Definition: fts0types.h:198
uint64_t total_size_before_sync
total size of fts cache, when last SYNC request was sent
Definition: fts0types.h:176
rw_lock_t init_lock
lock used for the cache initialization, it has different SYNC level as above cache lock
Definition: fts0types.h:150
mem_heap_t * cache_heap
Cache Heap.
Definition: fts0types.h:207
ulint total_size
total size consumed by the ilist field of all nodes.
Definition: fts0types.h:173
doc_id_t first_doc_id
first doc id since this table was opened
Definition: fts0types.h:195
doc_id_t synced_doc_id
Doc ID sync-ed to CONFIG table.
Definition: fts0types.h:193
ulint added
Number of doc ids added since last optimized.
Definition: fts0types.h:202
ib_alloc_t * self_heap
This heap is the heap out of which an instance of the cache itself was created.
Definition: fts0types.h:185
ib_mutex_t deleted_lock
Lock covering deleted_doc_ids.
Definition: fts0types.h:157
ib_vector_t * deleted_doc_ids
Array of deleted doc ids, each element is of type fts_update_t.
Definition: fts0types.h:161
fts_stopword_t stopword_info
Cached stopwords for the FTS.
Definition: fts0types.h:206
ib_vector_t * indexes
We store the stats and inverted index for the individual FTS indexes in this vector.
Definition: fts0types.h:164
ib_mutex_t optimize_lock
Lock for OPTIMIZE.
Definition: fts0types.h:155
doc_id_t next_doc_id
Next doc id.
Definition: fts0types.h:191
ib_mutex_t doc_id_lock
Lock covering Doc ID.
Definition: fts0types.h:159
Statistics relevant to a particular document, used during retrieval.
Definition: fts0types.h:54
doc_id_t doc_id
Document id.
Definition: fts0types.h:55
ulint word_count
Total words in the document.
Definition: fts0types.h:56
This type represents a single document field.
Definition: fts0types.h:272
fts_string_t text
document text
Definition: fts0types.h:273
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:283
ib_rbt_t * tokens
This is filled when the document is tokenized.
Definition: fts0types.h:278
bool found
true if the document was found successfully in the database
Definition: fts0types.h:275
bool is_ngram
Whether it is a ngram parser.
Definition: fts0types.h:292
CHARSET_INFO * charset
Document's charset info.
Definition: fts0types.h:288
ib_rbt_t * stopwords
Stopwords.
Definition: fts0types.h:294
st_mysql_ftparser * parser
fts plugin parser
Definition: fts0types.h:290
Callback for reading and filtering nodes that are read from FTS index.
Definition: fts0types.h:251
void * read_arg
Arg for the sql_callback.
Definition: fts0types.h:252
fts_sql_callback read_record
Callback for reading index record.
Definition: fts0types.h:254
ulint total_memory
Total memory used.
Definition: fts0types.h:256
It's main purpose is to store the SQL prepared statements that are required to retrieve a document fr...
Definition: fts0types.h:61
fts_cache_t * cache
The parent cache.
Definition: fts0types.h:66
que_t * get_document_graph
Definition: fts0types.h:65
fts_index_cache_t * index_cache
The index cache instance.
Definition: fts0types.h:62
Since we can have multiple FTS indexes on a table, we keep a per index cache of words etc.
Definition: fts0types.h:71
que_t ** sel_graph
Select query graphs.
Definition: fts0types.h:86
que_t ** ins_graph
Insert query graphs.
Definition: fts0types.h:84
dict_index_t * index
The FTS index instance.
Definition: fts0types.h:72
ib_vector_t * doc_stats
Array of the fts_doc_stats_t contained in the memory buffer.
Definition: fts0types.h:77
ib_rbt_t * words
Nodes; indexed by fts_string_t*, cells are fts_tokenizer_word_t*.
Definition: fts0types.h:74
CHARSET_INFO * charset
charset
Definition: fts0types.h:87
For horizontally splitting an FTS auxiliary index.
Definition: fts0types.h:260
ulint value
Character value at which to split.
Definition: fts0types.h:261
const char * suffix
FTS aux index suffix.
Definition: fts0types.h:264
Columns of the FTS auxiliary INDEX table.
Definition: fts0types.h:211
bool synced
flag whether the node is synced
Definition: fts0types.h:231
ulint ilist_size_alloc
Allocated size of ilist in bytes.
Definition: fts0types.h:228
byte * ilist
Binary list of documents & word positions the token appears in.
Definition: fts0types.h:216
ulint doc_count
Number of doc ids in ilist.
Definition: fts0types.h:224
doc_id_t last_doc_id
Last document id in ilist.
Definition: fts0types.h:214
ulint ilist_size
Used size of ilist in bytes.
Definition: fts0types.h:226
doc_id_t first_doc_id
First document id in ilist.
Definition: fts0types.h:212
Stop word control infotmation.
Definition: fts0types.h:105
ulint status
Status of the stopword tree.
Definition: fts0types.h:106
CHARSET_INFO * charset
charset for stopword
Definition: fts0types.h:109
ib_rbt_t * cached_stopword
This stores all active stopwords.
Definition: fts0types.h:108
ib_alloc_t * heap
The memory allocator to use.
Definition: fts0types.h:107
An UTF-16 ro UTF-8 string.
Definition: fts0fts.h:292
The SYNC state of the cache.
Definition: fts0types.h:114
bool unlock_cache
flag whether unlock cache when write fts node
Definition: fts0types.h:136
ulint upper_index
max index of the doc id vector to add to the FTS cache
Definition: fts0types.h:124
bool interrupted
true if SYNC was interrupted
Definition: fts0types.h:126
ulint max_cache_size
Max size in bytes of the cache.
Definition: fts0types.h:118
std::chrono::steady_clock::time_point start_time
SYNC start time.
Definition: fts0types.h:133
doc_id_t min_doc_id
The smallest doc id added to the cache.
Definition: fts0types.h:127
dict_table_t * table
Table with FTS index(es)
Definition: fts0types.h:117
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:130
os_event_t event
sync finish event
Definition: fts0types.h:138
ulint lower_index
the start index of the doc id vector from where to start adding documents to the FTS cache
Definition: fts0types.h:121
bool in_progress
flag whether sync is in progress.
Definition: fts0types.h:135
trx_t * trx
The transaction used for SYNCing the cache to disk.
Definition: fts0types.h:115
bool cache_full
flag, when true it indicates that we need to sync the cache to disk
Definition: fts0types.h:119
A token and its positions within a document.
Definition: fts0types.h:298
fts_string_t text
token text
Definition: fts0types.h:299
ib_vector_t * positions
an array of the positions the token is found in; each item is actually an ulint.
Definition: fts0types.h:301
A tokenizer word.
Definition: fts0types.h:235
ib_vector_t * nodes
Word node ilists, each element is of type fts_node_t.
Definition: fts0types.h:238
fts_string_t text
Token text.
Definition: fts0types.h:236
For supporting the tracking of updates on multiple FTS indexes we need to track which FTS indexes nee...
Definition: fts0types.h:93
ib_vector_t * fts_indexes
The FTS indexes that need to be updated.
Definition: fts0types.h:96
doc_id_t doc_id
The doc id affected.
Definition: fts0types.h:94
Word text plus it's array of nodes as on disk in FTS index.
Definition: fts0types.h:243
ib_alloc_t * heap_alloc
For handling all allocations.
Definition: fts0types.h:247
fts_string_t text
Word value in UTF-8.
Definition: fts0types.h:244
ib_vector_t * nodes
Nodes read from disk.
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
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:360
Definition: plugin_ftparser.h:212
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.