github.com/whtcorpsinc/milevadb-prod@v0.0.0-20211104133533-f57f4be3b597/schemareplicant/perfschema/const.go (about)

     1  // Copyright 2020 WHTCORPS INC, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package perfschema
    15  
    16  // perfSchemaBlocks is a shortcut to involve all causet names.
    17  var perfSchemaBlocks = []string{
    18  	blockGlobalStatus,
    19  	blockStochastikStatus,
    20  	blockSetupActors,
    21  	blockSetupObjects,
    22  	blockSetupInstruments,
    23  	blockSetupConsumers,
    24  	blockStmtsCurrent,
    25  	blockStmtsHistory,
    26  	blockStmtsHistoryLong,
    27  	blockPreparedStmtsInstances,
    28  	blockTransCurrent,
    29  	blockTransHistory,
    30  	blockTransHistoryLong,
    31  	blockStagesCurrent,
    32  	blockStagesHistory,
    33  	blockStagesHistoryLong,
    34  	blockEventsStatementsSummaryByDigest,
    35  	blockMilevaDBProfileCPU,
    36  	blockMilevaDBProfileMemory,
    37  	blockMilevaDBProfileMutex,
    38  	blockMilevaDBProfileAllocs,
    39  	blockMilevaDBProfileBlock,
    40  	blockMilevaDBProfileGoroutines,
    41  	blockEinsteinDBProfileCPU,
    42  	blockFIDelProfileCPU,
    43  	blockFIDelProfileMemory,
    44  	blockFIDelProfileMutex,
    45  	blockFIDelProfileAllocs,
    46  	blockFIDelProfileBlock,
    47  	blockFIDelProfileGoroutines,
    48  }
    49  
    50  // blockGlobalStatus contains the defCausumn name definitions for causet global_status, same as MyALLEGROSQL.
    51  const blockGlobalStatus = "CREATE TABLE performance_schema." + blockNameGlobalStatus + " (" +
    52  	"VARIABLE_NAME VARCHAR(64) not null," +
    53  	"VARIABLE_VALUE VARCHAR(1024));"
    54  
    55  // blockStochastikStatus contains the defCausumn name definitions for causet stochastik_status, same as MyALLEGROSQL.
    56  const blockStochastikStatus = "CREATE TABLE performance_schema." + blockNameStochastikStatus + " (" +
    57  	"VARIABLE_NAME VARCHAR(64) not null," +
    58  	"VARIABLE_VALUE VARCHAR(1024));"
    59  
    60  // blockSetupActors contains the defCausumn name definitions for causet setup_actors, same as MyALLEGROSQL.
    61  const blockSetupActors = "CREATE TABLE if not exists performance_schema." + blockNameSetupActors + " (" +
    62  	"HOST			CHAR(60) NOT NULL  DEFAULT '%'," +
    63  	"USER			CHAR(32) NOT NULL  DEFAULT '%'," +
    64  	"ROLE			CHAR(16) NOT NULL  DEFAULT '%'," +
    65  	"ENABLED		ENUM('YES','NO') NOT NULL  DEFAULT 'YES'," +
    66  	"HISTORY		ENUM('YES','NO') NOT NULL  DEFAULT 'YES');"
    67  
    68  // blockSetupObjects contains the defCausumn name definitions for causet setup_objects, same as MyALLEGROSQL.
    69  const blockSetupObjects = "CREATE TABLE if not exists performance_schema." + blockNameSetupObjects + " (" +
    70  	"OBJECT_TYPE		ENUM('EVENT','FUNCTION','TABLE') NOT NULL  DEFAULT 'TABLE'," +
    71  	"OBJECT_SCHEMA		VARCHAR(64)  DEFAULT '%'," +
    72  	"OBJECT_NAME		VARCHAR(64) NOT NULL  DEFAULT '%'," +
    73  	"ENABLED		ENUM('YES','NO') NOT NULL  DEFAULT 'YES'," +
    74  	"TIMED			ENUM('YES','NO') NOT NULL  DEFAULT 'YES');"
    75  
    76  // blockSetupInstruments contains the defCausumn name definitions for causet setup_instruments, same as MyALLEGROSQL.
    77  const blockSetupInstruments = "CREATE TABLE if not exists performance_schema." + blockNameSetupInstruments + " (" +
    78  	"NAME			VARCHAR(128) NOT NULL," +
    79  	"ENABLED		ENUM('YES','NO') NOT NULL," +
    80  	"TIMED			ENUM('YES','NO') NOT NULL);"
    81  
    82  // blockSetupConsumers contains the defCausumn name definitions for causet setup_consumers, same as MyALLEGROSQL.
    83  const blockSetupConsumers = "CREATE TABLE if not exists performance_schema." + blockNameSetupConsumers + " (" +
    84  	"NAME			VARCHAR(64) NOT NULL," +
    85  	"ENABLED			ENUM('YES','NO') NOT NULL);"
    86  
    87  // blockStmtsCurrent contains the defCausumn name definitions for causet events_memexs_current, same as MyALLEGROSQL.
    88  const blockStmtsCurrent = "CREATE TABLE if not exists performance_schema." + blockNameEventsStatementsCurrent + " (" +
    89  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
    90  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
    91  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
    92  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
    93  	"SOURCE			VARCHAR(64)," +
    94  	"TIMER_START		BIGINT(20) UNSIGNED," +
    95  	"TIMER_END		BIGINT(20) UNSIGNED," +
    96  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
    97  	"LOCK_TIME		BIGINT(20) UNSIGNED NOT NULL," +
    98  	"ALLEGROSQL_TEXT		LONGTEXT," +
    99  	"DIGEST			VARCHAR(32)," +
   100  	"DIGEST_TEXT		LONGTEXT," +
   101  	"CURRENT_SCHEMA	VARCHAR(64)," +
   102  	"OBJECT_TYPE		VARCHAR(64)," +
   103  	"OBJECT_SCHEMA	VARCHAR(64)," +
   104  	"OBJECT_NAME		VARCHAR(64)," +
   105  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED," +
   106  	"MYALLEGROSQL_ERRNO		INT(11)," +
   107  	"RETURNED_ALLEGROSQLSTATE	VARCHAR(5)," +
   108  	"MESSAGE_TEXT	VARCHAR(128)," +
   109  	"ERRORS			BIGINT(20) UNSIGNED NOT NULL," +
   110  	"WARNINGS		BIGINT(20) UNSIGNED NOT NULL," +
   111  	"ROWS_AFFECTED	BIGINT(20) UNSIGNED NOT NULL," +
   112  	"ROWS_SENT		BIGINT(20) UNSIGNED NOT NULL," +
   113  	"ROWS_EXAMINED	BIGINT(20) UNSIGNED NOT NULL," +
   114  	"CREATED_TMP_DISK_TABLES	BIGINT(20) UNSIGNED NOT NULL," +
   115  	"CREATED_TMP_TABLES		BIGINT(20) UNSIGNED NOT NULL," +
   116  	"SELECT_FULL_JOIN		BIGINT(20) UNSIGNED NOT NULL," +
   117  	"SELECT_FULL_RANGE_JOIN	BIGINT(20) UNSIGNED NOT NULL," +
   118  	"SELECT_RANGE	BIGINT(20) UNSIGNED NOT NULL," +
   119  	"SELECT_RANGE_CHECK		BIGINT(20) UNSIGNED NOT NULL," +
   120  	"SELECT_SCAN		BIGINT(20) UNSIGNED NOT NULL," +
   121  	"SORT_MERGE_PASSES		BIGINT(20) UNSIGNED NOT NULL," +
   122  	"SORT_RANGE		BIGINT(20) UNSIGNED NOT NULL," +
   123  	"SORT_ROWS		BIGINT(20) UNSIGNED NOT NULL," +
   124  	"SORT_SCAN		BIGINT(20) UNSIGNED NOT NULL," +
   125  	"NO_INDEX_USED	BIGINT(20) UNSIGNED NOT NULL," +
   126  	"NO_GOOD_INDEX_USED		BIGINT(20) UNSIGNED NOT NULL," +
   127  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   128  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE')," +
   129  	"NESTING_EVENT_LEVEL		INT(11));"
   130  
   131  // blockStmtsHistory contains the defCausumn name definitions for causet events_memexs_history, same as MyALLEGROSQL.
   132  const blockStmtsHistory = "CREATE TABLE if not exists performance_schema." + blockNameEventsStatementsHistory + " (" +
   133  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   134  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   135  	"END_EVENT_ID		BIGINT(20) UNSIGNED," +
   136  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   137  	"SOURCE			VARCHAR(64)," +
   138  	"TIMER_START		BIGINT(20) UNSIGNED," +
   139  	"TIMER_END		BIGINT(20) UNSIGNED," +
   140  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   141  	"LOCK_TIME		BIGINT(20) UNSIGNED NOT NULL," +
   142  	"ALLEGROSQL_TEXT		LONGTEXT," +
   143  	"DIGEST			VARCHAR(32)," +
   144  	"DIGEST_TEXT		LONGTEXT," +
   145  	"CURRENT_SCHEMA 	VARCHAR(64)," +
   146  	"OBJECT_TYPE		VARCHAR(64)," +
   147  	"OBJECT_SCHEMA	VARCHAR(64)," +
   148  	"OBJECT_NAME		VARCHAR(64)," +
   149  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED," +
   150  	"MYALLEGROSQL_ERRNO		INT(11)," +
   151  	"RETURNED_ALLEGROSQLSTATE		VARCHAR(5)," +
   152  	"MESSAGE_TEXT	VARCHAR(128)," +
   153  	"ERRORS			BIGINT(20) UNSIGNED NOT NULL," +
   154  	"WARNINGS		BIGINT(20) UNSIGNED NOT NULL," +
   155  	"ROWS_AFFECTED	BIGINT(20) UNSIGNED NOT NULL," +
   156  	"ROWS_SENT		BIGINT(20) UNSIGNED NOT NULL," +
   157  	"ROWS_EXAMINED	BIGINT(20) UNSIGNED NOT NULL," +
   158  	"CREATED_TMP_DISK_TABLES	BIGINT(20) UNSIGNED NOT NULL," +
   159  	"CREATED_TMP_TABLES		BIGINT(20) UNSIGNED NOT NULL," +
   160  	"SELECT_FULL_JOIN		BIGINT(20) UNSIGNED NOT NULL," +
   161  	"SELECT_FULL_RANGE_JOIN	BIGINT(20) UNSIGNED NOT NULL," +
   162  	"SELECT_RANGE	BIGINT(20) UNSIGNED NOT NULL," +
   163  	"SELECT_RANGE_CHECK		BIGINT(20) UNSIGNED NOT NULL," +
   164  	"SELECT_SCAN		BIGINT(20) UNSIGNED NOT NULL," +
   165  	"SORT_MERGE_PASSES		BIGINT(20) UNSIGNED NOT NULL," +
   166  	"SORT_RANGE		BIGINT(20) UNSIGNED NOT NULL," +
   167  	"SORT_ROWS		BIGINT(20) UNSIGNED NOT NULL," +
   168  	"SORT_SCAN		BIGINT(20) UNSIGNED NOT NULL," +
   169  	"NO_INDEX_USED	BIGINT(20) UNSIGNED NOT NULL," +
   170  	"NO_GOOD_INDEX_USED		BIGINT(20) UNSIGNED NOT NULL," +
   171  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   172  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE')," +
   173  	"NESTING_EVENT_LEVEL		INT(11));"
   174  
   175  // blockStmtsHistoryLong contains the defCausumn name definitions for causet events_memexs_history_long, same as MyALLEGROSQL.
   176  const blockStmtsHistoryLong = "CREATE TABLE if not exists performance_schema." + blockNameEventsStatementsHistoryLong + " (" +
   177  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   178  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   179  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   180  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   181  	"SOURCE			VARCHAR(64)," +
   182  	"TIMER_START		BIGINT(20) UNSIGNED," +
   183  	"TIMER_END		BIGINT(20) UNSIGNED," +
   184  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   185  	"LOCK_TIME		BIGINT(20) UNSIGNED NOT NULL," +
   186  	"ALLEGROSQL_TEXT		LONGTEXT," +
   187  	"DIGEST			VARCHAR(32)," +
   188  	"DIGEST_TEXT		LONGTEXT," +
   189  	"CURRENT_SCHEMA	VARCHAR(64)," +
   190  	"OBJECT_TYPE		VARCHAR(64)," +
   191  	"OBJECT_SCHEMA	VARCHAR(64)," +
   192  	"OBJECT_NAME		VARCHAR(64)," +
   193  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED," +
   194  	"MYALLEGROSQL_ERRNO		INT(11)," +
   195  	"RETURNED_ALLEGROSQLSTATE		VARCHAR(5)," +
   196  	"MESSAGE_TEXT	VARCHAR(128)," +
   197  	"ERRORS			BIGINT(20) UNSIGNED NOT NULL," +
   198  	"WARNINGS		BIGINT(20) UNSIGNED NOT NULL," +
   199  	"ROWS_AFFECTED	BIGINT(20) UNSIGNED NOT NULL," +
   200  	"ROWS_SENT		BIGINT(20) UNSIGNED NOT NULL," +
   201  	"ROWS_EXAMINED	BIGINT(20) UNSIGNED NOT NULL," +
   202  	"CREATED_TMP_DISK_TABLES	BIGINT(20) UNSIGNED NOT NULL," +
   203  	"CREATED_TMP_TABLES		BIGINT(20) UNSIGNED NOT NULL," +
   204  	"SELECT_FULL_JOIN		BIGINT(20) UNSIGNED NOT NULL," +
   205  	"SELECT_FULL_RANGE_JOIN	BIGINT(20) UNSIGNED NOT NULL," +
   206  	"SELECT_RANGE	BIGINT(20) UNSIGNED NOT NULL," +
   207  	"SELECT_RANGE_CHECK		BIGINT(20) UNSIGNED NOT NULL," +
   208  	"SELECT_SCAN		BIGINT(20) UNSIGNED NOT NULL," +
   209  	"SORT_MERGE_PASSES		BIGINT(20) UNSIGNED NOT NULL," +
   210  	"SORT_RANGE		BIGINT(20) UNSIGNED NOT NULL," +
   211  	"SORT_ROWS		BIGINT(20) UNSIGNED NOT NULL," +
   212  	"SORT_SCAN		BIGINT(20) UNSIGNED NOT NULL," +
   213  	"NO_INDEX_USED	BIGINT(20) UNSIGNED NOT NULL," +
   214  	"NO_GOOD_INDEX_USED		BIGINT(20) UNSIGNED NOT NULL," +
   215  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   216  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE')," +
   217  	"NESTING_EVENT_LEVEL		INT(11));"
   218  
   219  // blockPreparedStmtsInstances contains the defCausumn name definitions for causet prepared_memexs_instances, same as MyALLEGROSQL.
   220  const blockPreparedStmtsInstances = "CREATE TABLE if not exists performance_schema." + blockNamePreparedStatementsInstances + " (" +
   221  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED NOT NULL," +
   222  	"STATEMENT_ID	BIGINT(20) UNSIGNED NOT NULL," +
   223  	"STATEMENT_NAME	VARCHAR(64)," +
   224  	"ALLEGROSQL_TEXT		LONGTEXT NOT NULL," +
   225  	"OWNER_THREAD_ID	BIGINT(20) UNSIGNED NOT NULL," +
   226  	"OWNER_EVENT_ID	BIGINT(20) UNSIGNED NOT NULL," +
   227  	"OWNER_OBJECT_TYPE		ENUM('EVENT','FUNCTION','TABLE')," +
   228  	"OWNER_OBJECT_SCHEMA		VARCHAR(64)," +
   229  	"OWNER_OBJECT_NAME		VARCHAR(64)," +
   230  	"TIMER_PREPARE	BIGINT(20) UNSIGNED NOT NULL," +
   231  	"COUNT_REPREPARE	BIGINT(20) UNSIGNED NOT NULL," +
   232  	"COUNT_EXECUTE	BIGINT(20) UNSIGNED NOT NULL," +
   233  	"SUM_TIMER_EXECUTE		BIGINT(20) UNSIGNED NOT NULL," +
   234  	"MIN_TIMER_EXECUTE		BIGINT(20) UNSIGNED NOT NULL," +
   235  	"AVG_TIMER_EXECUTE		BIGINT(20) UNSIGNED NOT NULL," +
   236  	"MAX_TIMER_EXECUTE		BIGINT(20) UNSIGNED NOT NULL," +
   237  	"SUM_LOCK_TIME	BIGINT(20) UNSIGNED NOT NULL," +
   238  	"SUM_ERRORS		BIGINT(20) UNSIGNED NOT NULL," +
   239  	"SUM_WARNINGS	BIGINT(20) UNSIGNED NOT NULL," +
   240  	"		SUM_ROWS_AFFECTED		BIGINT(20) UNSIGNED NOT NULL," +
   241  	"SUM_ROWS_SENT	BIGINT(20) UNSIGNED NOT NULL," +
   242  	"SUM_ROWS_EXAMINED		BIGINT(20) UNSIGNED NOT NULL," +
   243  	"SUM_CREATED_TMP_DISK_TABLES	BIGINT(20) UNSIGNED NOT NULL," +
   244  	"SUM_CREATED_TMP_TABLES	BIGINT(20) UNSIGNED NOT NULL," +
   245  	"SUM_SELECT_FULL_JOIN	BIGINT(20) UNSIGNED NOT NULL," +
   246  	"SUM_SELECT_FULL_RANGE_JOIN	BIGINT(20) UNSIGNED NOT NULL," +
   247  	"SUM_SELECT_RANGE		BIGINT(20) UNSIGNED NOT NULL," +
   248  	"SUM_SELECT_RANGE_CHECK	BIGINT(20) UNSIGNED NOT NULL," +
   249  	"SUM_SELECT_SCAN	BIGINT(20) UNSIGNED NOT NULL," +
   250  	"SUM_SORT_MERGE_PASSES	BIGINT(20) UNSIGNED NOT NULL," +
   251  	"SUM_SORT_RANGE	BIGINT(20) UNSIGNED NOT NULL," +
   252  	"SUM_SORT_ROWS	BIGINT(20) UNSIGNED NOT NULL," +
   253  	"SUM_SORT_SCAN	BIGINT(20) UNSIGNED NOT NULL," +
   254  	"SUM_NO_INDEX_USED		BIGINT(20) UNSIGNED NOT NULL," +
   255  	"SUM_NO_GOOD_INDEX_USED	BIGINT(20) UNSIGNED NOT NULL);"
   256  
   257  // blockTransCurrent contains the defCausumn name definitions for causet events_transactions_current, same as MyALLEGROSQL.
   258  const blockTransCurrent = "CREATE TABLE if not exists performance_schema." + blockNameEventsTransactionsCurrent + " (" +
   259  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   260  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   261  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   262  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   263  	"STATE			ENUM('ACTIVE','COMMITTED','ROLLED BACK')," +
   264  	"TRX_ID			BIGINT(20) UNSIGNED," +
   265  	"GTID			VARCHAR(64)," +
   266  	"XID_FORMAT_ID	INT(11)," +
   267  	"XID_GTRID		VARCHAR(130)," +
   268  	"XID_BQUAL		VARCHAR(130)," +
   269  	"XA_STATE		VARCHAR(64)," +
   270  	"SOURCE			VARCHAR(64)," +
   271  	"TIMER_START		BIGINT(20) UNSIGNED," +
   272  	"TIMER_END		BIGINT(20) UNSIGNED," +
   273  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   274  	"ACCESS_MODE		ENUM('READ ONLY','READ WRITE')," +
   275  	"ISOLATION_LEVEL	VARCHAR(64)," +
   276  	"AUTOCOMMIT		ENUM('YES','NO') NOT NULL," +
   277  	"NUMBER_OF_SAVEPOINTS	BIGINT(20) UNSIGNED," +
   278  	"NUMBER_OF_ROLLBACK_TO_SAVEPOINT	BIGINT(20) UNSIGNED," +
   279  	"NUMBER_OF_RELEASE_SAVEPOINT		BIGINT(20) UNSIGNED," +
   280  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED," +
   281  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   282  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE'));"
   283  
   284  // blockTransHistory contains the defCausumn name definitions for causet events_transactions_history, same as MyALLEGROSQL.
   285  //
   286  const blockTransHistory = "CREATE TABLE if not exists performance_schema." + blockNameEventsTransactionsHistory + " (" +
   287  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   288  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   289  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   290  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   291  	"STATE			ENUM('ACTIVE','COMMITTED','ROLLED BACK')," +
   292  	"TRX_ID			BIGINT(20) UNSIGNED," +
   293  	"GTID			VARCHAR(64)," +
   294  	"XID_FORMAT_ID	INT(11)," +
   295  	"XID_GTRID		VARCHAR(130)," +
   296  	"XID_BQUAL		VARCHAR(130)," +
   297  	"XA_STATE		VARCHAR(64)," +
   298  	"SOURCE			VARCHAR(64)," +
   299  	"TIMER_START		BIGINT(20) UNSIGNED," +
   300  	"TIMER_END		BIGINT(20) UNSIGNED," +
   301  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   302  	"ACCESS_MODE		ENUM('READ ONLY','READ WRITE')," +
   303  	"ISOLATION_LEVEL	VARCHAR(64)," +
   304  	"AUTOCOMMIT		ENUM('YES','NO') NOT NULL," +
   305  	"NUMBER_OF_SAVEPOINTS	BIGINT(20) UNSIGNED," +
   306  	"NUMBER_OF_ROLLBACK_TO_SAVEPOINT	BIGINT(20) UNSIGNED," +
   307  	"NUMBER_OF_RELEASE_SAVEPOINT		BIGINT(20) UNSIGNED," +
   308  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED," +
   309  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   310  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE'));"
   311  
   312  // blockTransHistoryLong contains the defCausumn name definitions for causet events_transactions_history_long, same as MyALLEGROSQL.
   313  const blockTransHistoryLong = "CREATE TABLE if not exists performance_schema." + blockNameEventsTransactionsHistoryLong + " (" +
   314  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   315  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   316  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   317  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   318  	"STATE			ENUM('ACTIVE','COMMITTED','ROLLED BACK')," +
   319  	"TRX_ID			BIGINT(20) UNSIGNED," +
   320  	"GTID			VARCHAR(64)," +
   321  	"XID_FORMAT_ID	INT(11)," +
   322  	"XID_GTRID		VARCHAR(130)," +
   323  	"XID_BQUAL		VARCHAR(130)," +
   324  	"XA_STATE		VARCHAR(64)," +
   325  	"SOURCE			VARCHAR(64)," +
   326  	"TIMER_START		BIGINT(20) UNSIGNED," +
   327  	"TIMER_END		BIGINT(20) UNSIGNED," +
   328  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   329  	"ACCESS_MODE		ENUM('READ ONLY','READ WRITE')," +
   330  	"ISOLATION_LEVEL	VARCHAR(64)," +
   331  	"AUTOCOMMIT		ENUM('YES','NO') NOT NULL," +
   332  	"NUMBER_OF_SAVEPOINTS	BIGINT(20) UNSIGNED," +
   333  	"NUMBER_OF_ROLLBACK_TO_SAVEPOINT	BIGINT(20) UNSIGNED," +
   334  	"NUMBER_OF_RELEASE_SAVEPOINT		BIGINT(20) UNSIGNED," +
   335  	"OBJECT_INSTANCE_BEGIN	BIGINT(20) UNSIGNED," +
   336  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   337  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE'));"
   338  
   339  // blockStagesCurrent contains the defCausumn name definitions for causet events_stages_current, same as MyALLEGROSQL.
   340  const blockStagesCurrent = "CREATE TABLE if not exists performance_schema." + blockNameEventsStagesCurrent + " (" +
   341  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   342  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   343  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   344  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   345  	"SOURCE			VARCHAR(64)," +
   346  	"TIMER_START		BIGINT(20) UNSIGNED," +
   347  	"TIMER_END		BIGINT(20) UNSIGNED," +
   348  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   349  	"WORK_COMPLETED	BIGINT(20) UNSIGNED," +
   350  	"WORK_ESTIMATED	BIGINT(20) UNSIGNED," +
   351  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   352  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE'));"
   353  
   354  // blockStagesHistory contains the defCausumn name definitions for causet events_stages_history, same as MyALLEGROSQL.
   355  const blockStagesHistory = "CREATE TABLE if not exists performance_schema." + blockNameEventsStagesHistory + " (" +
   356  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   357  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   358  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   359  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   360  	"SOURCE			VARCHAR(64)," +
   361  	"TIMER_START		BIGINT(20) UNSIGNED," +
   362  	"TIMER_END		BIGINT(20) UNSIGNED," +
   363  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   364  	"WORK_COMPLETED	BIGINT(20) UNSIGNED," +
   365  	"WORK_ESTIMATED	BIGINT(20) UNSIGNED," +
   366  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   367  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE'));"
   368  
   369  // blockStagesHistoryLong contains the defCausumn name definitions for causet events_stages_history_long, same as MyALLEGROSQL.
   370  const blockStagesHistoryLong = "CREATE TABLE if not exists performance_schema." + blockNameEventsStagesHistoryLong + " (" +
   371  	"THREAD_ID		BIGINT(20) UNSIGNED NOT NULL," +
   372  	"EVENT_ID		BIGINT(20) UNSIGNED NOT NULL," +
   373  	"END_EVENT_ID	BIGINT(20) UNSIGNED," +
   374  	"EVENT_NAME		VARCHAR(128) NOT NULL," +
   375  	"SOURCE			VARCHAR(64)," +
   376  	"TIMER_START		BIGINT(20) UNSIGNED," +
   377  	"TIMER_END		BIGINT(20) UNSIGNED," +
   378  	"TIMER_WAIT		BIGINT(20) UNSIGNED," +
   379  	"WORK_COMPLETED	BIGINT(20) UNSIGNED," +
   380  	"WORK_ESTIMATED	BIGINT(20) UNSIGNED," +
   381  	"NESTING_EVENT_ID		BIGINT(20) UNSIGNED," +
   382  	"NESTING_EVENT_TYPE		ENUM('TRANSACTION','STATEMENT','STAGE'));"
   383  
   384  // blockEventsStatementsSummaryByDigest contains the defCausumn name definitions for causet
   385  // events_memexs_summary_by_digest, same as MyALLEGROSQL.
   386  const blockEventsStatementsSummaryByDigest = "CREATE TABLE if not exists performance_schema." + blockNameEventsStatementsSummaryByDigest + " (" +
   387  	"SCHEMA_NAME varchar(64) DEFAULT NULL," +
   388  	"DIGEST varchar(64) DEFAULT NULL," +
   389  	"DIGEST_TEXT longtext," +
   390  	"COUNT_STAR bigint unsigned NOT NULL," +
   391  	"SUM_TIMER_WAIT bigint unsigned NOT NULL," +
   392  	"MIN_TIMER_WAIT bigint unsigned NOT NULL," +
   393  	"AVG_TIMER_WAIT bigint unsigned NOT NULL," +
   394  	"MAX_TIMER_WAIT bigint unsigned NOT NULL," +
   395  	"SUM_LOCK_TIME bigint unsigned NOT NULL," +
   396  	"SUM_ERRORS bigint unsigned NOT NULL," +
   397  	"SUM_WARNINGS bigint unsigned NOT NULL," +
   398  	"SUM_ROWS_AFFECTED bigint unsigned NOT NULL," +
   399  	"SUM_ROWS_SENT bigint unsigned NOT NULL," +
   400  	"SUM_ROWS_EXAMINED bigint unsigned NOT NULL," +
   401  	"SUM_CREATED_TMP_DISK_TABLES bigint unsigned NOT NULL," +
   402  	"SUM_CREATED_TMP_TABLES bigint unsigned NOT NULL," +
   403  	"SUM_SELECT_FULL_JOIN bigint unsigned NOT NULL," +
   404  	"SUM_SELECT_FULL_RANGE_JOIN bigint unsigned NOT NULL," +
   405  	"SUM_SELECT_RANGE bigint unsigned NOT NULL," +
   406  	"SUM_SELECT_RANGE_CHECK bigint unsigned NOT NULL," +
   407  	"SUM_SELECT_SCAN bigint unsigned NOT NULL," +
   408  	"SUM_SORT_MERGE_PASSES bigint unsigned NOT NULL," +
   409  	"SUM_SORT_RANGE bigint unsigned NOT NULL," +
   410  	"SUM_SORT_ROWS bigint unsigned NOT NULL," +
   411  	"SUM_SORT_SCAN bigint unsigned NOT NULL," +
   412  	"SUM_NO_INDEX_USED bigint unsigned NOT NULL," +
   413  	"SUM_NO_GOOD_INDEX_USED bigint unsigned NOT NULL," +
   414  	"FIRST_SEEN timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'," +
   415  	"LAST_SEEN timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'," +
   416  	"PLAN_IN_CACHE bool NOT NULL," +
   417  	"PLAN_CACHE_HITS bigint unsigned NOT NULL," +
   418  	"QUANTILE_95 bigint unsigned NOT NULL," +
   419  	"QUANTILE_99 bigint unsigned NOT NULL," +
   420  	"QUANTILE_999 bigint unsigned NOT NULL," +
   421  	"QUERY_SAMPLE_TEXT longtext," +
   422  	"QUERY_SAMPLE_SEEN timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'," +
   423  	"QUERY_SAMPLE_TIMER_WAIT bigint unsigned NOT NULL," +
   424  	"UNIQUE KEY `SCHEMA_NAME` (`SCHEMA_NAME`,`DIGEST`));"
   425  
   426  // blockMilevaDBProfileCPU contains the defCausumns name definitions for causet milevadb_profile_cpu
   427  const blockMilevaDBProfileCPU = "CREATE TABLE IF NOT EXISTS " + blockNameMilevaDBProfileCPU + " (" +
   428  	"FUNCTION VARCHAR(512) NOT NULL," +
   429  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   430  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   431  	"ROOT_CHILD INT(8) NOT NULL," +
   432  	"DEPTH INT(8) NOT NULL," +
   433  	"FILE VARCHAR(512) NOT NULL);"
   434  
   435  // blockMilevaDBProfileMemory contains the defCausumns name definitions for causet milevadb_profile_memory
   436  const blockMilevaDBProfileMemory = "CREATE TABLE IF NOT EXISTS " + blockNameMilevaDBProfileMemory + " (" +
   437  	"FUNCTION VARCHAR(512) NOT NULL," +
   438  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   439  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   440  	"ROOT_CHILD INT(8) NOT NULL," +
   441  	"DEPTH INT(8) NOT NULL," +
   442  	"FILE VARCHAR(512) NOT NULL);"
   443  
   444  // blockMilevaDBProfileMutex contains the defCausumns name definitions for causet milevadb_profile_mutex
   445  const blockMilevaDBProfileMutex = "CREATE TABLE IF NOT EXISTS " + blockNameMilevaDBProfileMutex + " (" +
   446  	"FUNCTION VARCHAR(512) NOT NULL," +
   447  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   448  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   449  	"ROOT_CHILD INT(8) NOT NULL," +
   450  	"DEPTH INT(8) NOT NULL," +
   451  	"FILE VARCHAR(512) NOT NULL);"
   452  
   453  // blockMilevaDBProfileAllocs contains the defCausumns name definitions for causet milevadb_profile_allocs
   454  const blockMilevaDBProfileAllocs = "CREATE TABLE IF NOT EXISTS " + blockNameMilevaDBProfileAllocs + " (" +
   455  	"FUNCTION VARCHAR(512) NOT NULL," +
   456  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   457  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   458  	"ROOT_CHILD INT(8) NOT NULL," +
   459  	"DEPTH INT(8) NOT NULL," +
   460  	"FILE VARCHAR(512) NOT NULL);"
   461  
   462  // blockMilevaDBProfileBlock contains the defCausumns name definitions for causet milevadb_profile_block
   463  const blockMilevaDBProfileBlock = "CREATE TABLE IF NOT EXISTS " + blockNameMilevaDBProfileBlock + " (" +
   464  	"FUNCTION VARCHAR(512) NOT NULL," +
   465  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   466  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   467  	"ROOT_CHILD INT(8) NOT NULL," +
   468  	"DEPTH INT(8) NOT NULL," +
   469  	"FILE VARCHAR(512) NOT NULL);"
   470  
   471  // blockMilevaDBProfileGoroutines contains the defCausumns name definitions for causet milevadb_profile_goroutines
   472  const blockMilevaDBProfileGoroutines = "CREATE TABLE IF NOT EXISTS " + blockNameMilevaDBProfileGoroutines + " (" +
   473  	"FUNCTION VARCHAR(512) NOT NULL," +
   474  	"ID INT(8) NOT NULL," +
   475  	"STATE VARCHAR(16) NOT NULL," +
   476  	"LOCATION VARCHAR(512) NOT NULL);"
   477  
   478  // blockEinsteinDBProfileCPU contains the defCausumns name definitions for causet einsteindb_profile_cpu
   479  const blockEinsteinDBProfileCPU = "CREATE TABLE IF NOT EXISTS " + blockNameEinsteinDBProfileCPU + " (" +
   480  	"ADDRESS VARCHAR(64) NOT NULL," +
   481  	"FUNCTION VARCHAR(512) NOT NULL," +
   482  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   483  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   484  	"ROOT_CHILD INT(8) NOT NULL," +
   485  	"DEPTH INT(8) NOT NULL," +
   486  	"FILE VARCHAR(512) NOT NULL);"
   487  
   488  // blockFIDelProfileCPU contains the defCausumns name definitions for causet FIDel_profile_cpu
   489  const blockFIDelProfileCPU = "CREATE TABLE IF NOT EXISTS " + blockNameFIDelProfileCPU + " (" +
   490  	"ADDRESS VARCHAR(64) NOT NULL," +
   491  	"FUNCTION VARCHAR(512) NOT NULL," +
   492  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   493  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   494  	"ROOT_CHILD INT(8) NOT NULL," +
   495  	"DEPTH INT(8) NOT NULL," +
   496  	"FILE VARCHAR(512) NOT NULL);"
   497  
   498  // blockFIDelProfileMemory contains the defCausumns name definitions for causet FIDel_profile_cpu_memory
   499  const blockFIDelProfileMemory = "CREATE TABLE IF NOT EXISTS " + blockNameFIDelProfileMemory + " (" +
   500  	"ADDRESS VARCHAR(64) NOT NULL," +
   501  	"FUNCTION VARCHAR(512) NOT NULL," +
   502  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   503  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   504  	"ROOT_CHILD INT(8) NOT NULL," +
   505  	"DEPTH INT(8) NOT NULL," +
   506  	"FILE VARCHAR(512) NOT NULL);"
   507  
   508  // blockFIDelProfileMutex contains the defCausumns name definitions for causet FIDel_profile_mutex
   509  const blockFIDelProfileMutex = "CREATE TABLE IF NOT EXISTS " + blockNameFIDelProfileMutex + " (" +
   510  	"ADDRESS VARCHAR(64) NOT NULL," +
   511  	"FUNCTION VARCHAR(512) NOT NULL," +
   512  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   513  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   514  	"ROOT_CHILD INT(8) NOT NULL," +
   515  	"DEPTH INT(8) NOT NULL," +
   516  	"FILE VARCHAR(512) NOT NULL);"
   517  
   518  // blockFIDelProfileAllocs contains the defCausumns name definitions for causet FIDel_profile_allocs
   519  const blockFIDelProfileAllocs = "CREATE TABLE IF NOT EXISTS " + blockNameFIDelProfileAllocs + " (" +
   520  	"ADDRESS VARCHAR(64) NOT NULL," +
   521  	"FUNCTION VARCHAR(512) NOT NULL," +
   522  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   523  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   524  	"ROOT_CHILD INT(8) NOT NULL," +
   525  	"DEPTH INT(8) NOT NULL," +
   526  	"FILE VARCHAR(512) NOT NULL);"
   527  
   528  // blockFIDelProfileBlock contains the defCausumns name definitions for causet FIDel_profile_block
   529  const blockFIDelProfileBlock = "CREATE TABLE IF NOT EXISTS " + blockNameFIDelProfileBlock + " (" +
   530  	"ADDRESS VARCHAR(64) NOT NULL," +
   531  	"FUNCTION VARCHAR(512) NOT NULL," +
   532  	"PERCENT_ABS VARCHAR(8) NOT NULL," +
   533  	"PERCENT_REL VARCHAR(8) NOT NULL," +
   534  	"ROOT_CHILD INT(8) NOT NULL," +
   535  	"DEPTH INT(8) NOT NULL," +
   536  	"FILE VARCHAR(512) NOT NULL);"
   537  
   538  // blockFIDelProfileGoroutines contains the defCausumns name definitions for causet FIDel_profile_goroutines
   539  const blockFIDelProfileGoroutines = "CREATE TABLE IF NOT EXISTS " + blockNameFIDelProfileGoroutines + " (" +
   540  	"ADDRESS VARCHAR(64) NOT NULL," +
   541  	"FUNCTION VARCHAR(512) NOT NULL," +
   542  	"ID INT(8) NOT NULL," +
   543  	"STATE VARCHAR(16) NOT NULL," +
   544  	"LOCATION VARCHAR(512) NOT NULL);"