From e954d9de886aebc68c39240304fe97ae88276dbb Mon Sep 17 00:00:00 2001 From: Kentoku SHIBA Date: Tue, 3 Mar 2020 02:50:40 +0900 Subject: MDEV-19002 Spider performance optimization with partition Change the following function for batch call instead of each partition - store_lock - external_lock - start_stmt - extra - cond_push - info_push - top_table --- storage/spider/ha_spider.h | 69 +++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 38 deletions(-) (limited to 'storage/spider/ha_spider.h') diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h index 4a7b685527d..b259e9cf098 100644 --- a/storage/spider/ha_spider.h +++ b/storage/spider/ha_spider.h @@ -52,9 +52,7 @@ struct st_spider_ft_info class ha_spider: public handler { public: - THR_LOCK_DATA lock; SPIDER_SHARE *share; - SPIDER_TRX *trx; ulonglong spider_thread_id; ulonglong trx_conn_adjustment; #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) @@ -90,18 +88,16 @@ public: int search_link_idx; int result_link_idx; SPIDER_RESULT_LIST result_list; - SPIDER_CONDITION *condition; spider_string *blob_buff; - uchar *searched_bitmap; - uchar *ft_discard_bitmap; - bool position_bitmap_init; - uchar *position_bitmap; SPIDER_POSITION *pushed_pos; SPIDER_POSITION pushed_pos_buf; #ifdef WITH_PARTITION_STORAGE_ENGINE + bool pt_handler_share_owner = FALSE; SPIDER_PARTITION_HANDLER_SHARE *partition_handler_share; - ha_spider *pt_handler_share_creator; #endif + bool wide_handler_owner = FALSE; + SPIDER_WIDE_HANDLER *wide_handler = NULL; + #ifdef HA_CAN_BULK_ACCESS int pre_direct_init_result; bool is_bulk_access_clone; @@ -116,10 +112,8 @@ public: bool init_ha_mem_root; MEM_ROOT ha_mem_root; */ - ulonglong external_lock_cnt; #endif bool is_clone; - bool clone_bitmap_init; ha_spider *pt_clone_source_handler; ha_spider *pt_clone_last_searcher; bool use_index_merge; @@ -161,22 +155,11 @@ public: ha_spider *next; + bool dml_inited; bool rnd_scan_and_first; - bool quick_mode; - bool keyread; - bool ignore_dup_key; - bool write_can_replace; - bool insert_with_update; - bool low_priority; - bool high_priority; - bool insert_delayed; bool use_pre_call; bool use_pre_action; bool pre_bitmap_checked; - enum thr_lock_type lock_type; - int lock_mode; - uint sql_command; - int selupd_lock_mode; bool bulk_insert; #ifdef HANDLER_HAS_NEED_INFO_FOR_AUTO_INC bool info_auto_called; @@ -189,12 +172,9 @@ public: int store_error_num; uint dup_key_idx; int select_column_mode; - bool update_request; bool pk_update; bool force_auto_increment; int bka_mode; - bool cond_check; - int cond_check_error; int error_mode; ulonglong store_last_insert_id; @@ -216,14 +196,7 @@ public: uint32 **hs_w_ret_fields; size_t *hs_r_ret_fields_num; size_t *hs_w_ret_fields_num; - uint32 *hs_pushed_ret_fields; - size_t hs_pushed_ret_fields_num; - size_t hs_pushed_ret_fields_size; - size_t hs_pushed_lcl_fields_num; uchar *tmp_column_bitmap; - bool hs_increment; - bool hs_decrement; - uint32 hs_pushed_strref_num; #endif #endif #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS @@ -232,11 +205,6 @@ public: bool maybe_do_hs_direct_update; #endif uint direct_update_kinds; - List *direct_update_fields; - List *direct_update_values; -#endif -#ifdef INFO_KIND_FORCE_LIMIT_BEGIN - longlong info_limit; #endif spider_index_rnd_init prev_index_rnd_init; #ifdef HANDLER_HAS_DIRECT_AGGREGATE @@ -283,10 +251,13 @@ public: uint test_if_locked ); int close(); - int check_access_kind( + int check_access_kind_for_connection( THD *thd, bool write_request ); + void check_access_kind( + THD *thd + ); #ifdef HA_CAN_BULK_ACCESS int additional_lock( THD *thd, @@ -302,6 +273,10 @@ public: THD *thd, int lock_type ); + int start_stmt( + THD *thd, + thr_lock_type lock_type + ); int reset(); int extra( enum ha_extra_function operation @@ -525,6 +500,7 @@ public: #endif const char *table_type() const; ulonglong table_flags() const; + ulong table_flags_for_partition(); const char *index_type( uint key_number ); @@ -869,6 +845,12 @@ public: int error_num, uint flags ); + int set_top_table_and_fields( + TABLE *top_table, + Field **top_table_field, + uint top_table_fields + ); + void clear_top_table_fields(); Field *get_top_table_field( uint16 field_index ); @@ -1255,4 +1237,15 @@ public: #endif int init_union_table_name_pos_sql(); int set_union_table_name_pos_sql(); + int lock_tables(); + int dml_init(); +#ifdef HA_CAN_BULK_ACCESS + int bulk_access_begin( + void *info + ); + int bulk_access_current( + void *info + ); + void bulk_access_end(); +#endif }; -- cgit v1.2.1