/** This structure defines information the scan thread will fetch andputtothelinkedlistforparalleltokenization/sortthreads
to process */ typedefstruct fts_doc_item fts_doc_item_t;
/** Information about temporary files used in merge sort */ struct fts_doc_item {
dfield_t* field; /*!< field contains document string */
doc_id_t doc_id; /*!< document ID */
UT_LIST_NODE_T(fts_doc_item_t) doc_list; /*!< list of doc items */
};
/** This defines the list type that scan thread would feed the parallel
tokenization threads and sort threads. */ typedef UT_LIST_BASE_NODE_T(fts_doc_item_t) fts_doc_list_t;
#define FTS_PLL_MERGE 1
/** Sort information passed to each individual parallel sort thread */ struct fts_psort_t;
/** Common info passed to each parallel sort thread */ struct fts_psort_common_t {
row_merge_dup_t* dup; /*!< descriptor of FTS index */
dict_table_t* new_table; /*!< source table */ /** Old table page size */
ulint old_zip_size;
trx_t* trx; /*!< transaction */
fts_psort_t* all_info; /*!< all parallel sort info */
pthread_cond_t sort_cond; /*!< sort completion */
ibool opt_doc_id_size;/*!< whether to use 4 bytes insteadof8bytesintegerto storeDocIDduringsort,if DocIDwillnotbebigenough
to use 8 bytes value */
};
struct fts_psort_t {
ulint psort_id; /*!< Parallel sort ID */
row_merge_buf_t* merge_buf[FTS_NUM_AUX_INDEX]; /*!< sort buffer */
merge_file_t* merge_file[FTS_NUM_AUX_INDEX]; /*!< sort file */
row_merge_block_t* merge_block[FTS_NUM_AUX_INDEX]; /*!< buffer to write to file */
row_merge_block_t* crypt_block[FTS_NUM_AUX_INDEX]; /*!< buffer to crypt data */
ulint child_status; /*!< child task status */
ulint state; /*!< parent state */
fts_doc_list_t fts_doc_list; /*!< doc list to process */
fts_psort_common_t* psort_common; /*!< ptr to all psort info */
tpool::waitable_task* task; /*!< threadpool task */
dberr_t error; /*!< db error during psort */
ulint memory_used; /*!< memory used by fts_doc_list */
mysql_mutex_t mutex; /*!< mutex for fts_doc_list */
};
/** Row fts token for plugin parser */ struct row_fts_token_t {
fts_string_t* text; /*!< token */
UT_LIST_NODE_T(row_fts_token_t)
token_list; /*!< next token link */
};
/** Structure stores information from string tokenization operation */ struct fts_tokenize_ctx { /** the processed string length in bytes (whenusingthebuilt-intokenizer),
or the number of row_merge_fts_doc_tokenize_by_parser() calls */
ulint processed_len;
ulint init_pos; /*!< doc start position */
ulint buf_used; /*!< the sort buffer (ID) when tokenizationstops,which
could due to sort buffer full */
ulint rows_added[FTS_NUM_AUX_INDEX]; /*!< number of rows added for
each FTS index partition */
ib_rbt_t* cached_stopword;/*!< in: stopword list */
dfield_t sort_field[FTS_NUM_FIELDS_SORT]; /*!< in: sort field */ /** parsed tokens (when using an external parser) */
fts_token_list_t fts_token_list;
/** status bit used for communication between parent and child thread */ #define FTS_PARENT_COMPLETE 1 #define FTS_PARENT_EXITING 2 #define FTS_CHILD_COMPLETE 1
/*************************************************************//**
Create a temporary "fts sort index" used to merge sort the
tokenized doc string. The index has three "fields":
1) Tokenized word, 2) Doc ID 3) Word's position in original 'doc'.
@return dict_index_t structure for the fts sort index */
dict_index_t*
row_merge_create_fts_sort_index( /*============================*/
dict_index_t* index, /*!< in: Original FTS index basedonwhichthissortindex
is created */
dict_table_t* table, /*!< in,out: table that FTS index
is being created on */ bool opt_doc_id_size); /*!< in: whether to use 4 bytes insteadof8bytesintegerto
store Doc ID during sort */
/********************************************************************//**
Clean up and deallocate FTS parallel sort structures, and close
temparary merge sort files */ void
row_fts_psort_info_destroy( /*=======================*/
fts_psort_t* psort_info, /*!< parallel sort info */
fts_psort_t* merge_info); /*!< parallel merge info */ /********************************************************************//**
Free up merge buffers when merge sort is done */ void
row_fts_free_pll_merge_buf( /*=======================*/
fts_psort_t* psort_info); /*!< in: parallel sort info */
/*********************************************************************//**
Start the parallel tokenization and parallel merge sort */ void
row_fts_start_psort( /*================*/
fts_psort_t* psort_info); /*!< in: parallel sort info */ /*********************************************************************//**
Kick off the parallel merge and insert thread */ void
row_fts_start_parallel_merge( /*=========================*/
fts_psort_t* merge_info); /*!< in: parallel sort info */ /********************************************************************//**
Propagate a newly added record up one level in the selection tree
@return parent where this value propagated to */ int
row_merge_fts_sel_propagate( /*========================*/ int propogated, /*<! in: tree node propagated */ int* sel_tree, /*<! in: selection tree */
ulint level, /*<! in: selection tree level */ const mrec_t** mrec, /*<! in: sort record */
rec_offs** offsets, /*<! in: record offsets */
dict_index_t* index); /*<! in: FTS index */ /********************************************************************//**
Read sorted file containing index data tuples and insert these data
tuples to the index
@return DB_SUCCESS or error number */
dberr_t
row_fts_merge_insert( /*=================*/
dict_index_t* index, /*!< in: index */
dict_table_t* table, /*!< in: new table */
fts_psort_t* psort_info, /*!< parallel sort info */
ulint id) /* !< in: which auxiliary table's data
to insert to */
MY_ATTRIBUTE((nonnull)); #endif/* row0ftsort_h */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 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.