mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
b66cdbd1ea
This makes it easier to compare different costs and also allows the optimizer to optimizer different storage engines more reliably. - Added tests/check_costs.pl, a tool to verify optimizer cost calculations. - Most engine costs has been found with this program. All steps to calculate the new costs are documented in Docs/optimizer_costs.txt - User optimizer_cost variables are given in microseconds (as individual costs can be very small). Internally they are stored in ms. - Changed DISK_READ_COST (was DISK_SEEK_BASE_COST) from a hard disk cost (9 ms) to common SSD cost (400MB/sec). - Removed cost calculations for hard disks (rotation etc). - Changed the following handler functions to return IO_AND_CPU_COST. This makes it easy to apply different cost modifiers in ha_..time() functions for io and cpu costs. - scan_time() - rnd_pos_time() & rnd_pos_call_time() - keyread_time() - Enhanched keyread_time() to calculate the full cost of reading of a set of keys with a given number of ranges and optional number of blocks that need to be accessed. - Removed read_time() as keyread_time() + rnd_pos_time() can do the same thing and more. - Tuned cost for: heap, myisam, Aria, InnoDB, archive and MyRocks. Used heap table costs for json_table. The rest are using default engine costs. - Added the following new optimizer variables: - optimizer_disk_read_ratio - optimizer_disk_read_cost - optimizer_key_lookup_cost - optimizer_row_lookup_cost - optimizer_row_next_find_cost - optimizer_scan_cost - Moved all engine specific cost to OPTIMIZER_COSTS structure. - Changed costs to use 'records_out' instead of 'records_read' when recalculating costs. - Split optimizer_costs.h to optimizer_costs.h and optimizer_defaults.h. This allows one to change costs without having to compile a lot of files. - Updated costs for filter lookup. - Use a better cost estimate in best_extension_by_limited_search() for the sorting cost. - Fixed previous issues with 'filtered' explain column as we are now using 'records_out' (min rows seen for table) to calculate filtering. This greatly simplifies the filtering code in JOIN_TAB::save_explain_data(). This change caused a lot of queries to be optimized differently than before, which exposed different issues in the optimizer that needs to be fixed. These fixes are in the following commits. To not have to change the same test case over and over again, the changes in the test cases are done in a single commit after all the critical change sets are done. InnoDB changes: - Updated InnoDB to not divide big range cost with 2. - Added cost for InnoDB (innobase_update_optimizer_costs()). - Don't mark clustered primary key with HA_KEYREAD_ONLY. This will prevent that the optimizer is trying to use index-only scans on the clustered key. - Disabled ha_innobase::scan_time() and ha_innobase::read_time() and ha_innobase::rnd_pos_time() as the default engine cost functions now works good for InnoDB. Other things: - Added --show-query-costs (\Q) option to mysql.cc to show the query cost after each query (good when working with query costs). - Extended my_getopt with GET_ADJUSTED_VALUE which allows one to adjust the value that user is given. This is used to change cost from microseconds (user input) to milliseconds (what the server is internally using). - Added include/my_tracker.h ; Useful include file to quickly test costs of a function. - Use handler::set_table() in all places instead of 'table= arg'. - Added SHOW_OPTIMIZER_COSTS to sys variables. These are input and shown in microseconds for the user but stored as milliseconds. This is to make the numbers easier to read for the user (less pre-zeros). Implemented in 'Sys_var_optimizer_cost' class. - In test_quick_select() do not use index scans if 'no_keyread' is set for the table. This is what we do in other places of the server. - Added THD parameter to Unique::get_use_cost() and check_index_intersect_extension() and similar functions to be able to provide costs to called functions. - Changed 'records' to 'rows' in optimizer_trace. - Write more information to optimizer_trace. - Added INDEX_BLOCK_FILL_FACTOR_MUL (4) and INDEX_BLOCK_FILL_FACTOR_DIV (3) to calculate usage space of keys in b-trees. (Before we used numeric constants). - Removed code that assumed that b-trees has similar costs as binary trees. Replaced with engine calls that returns the cost. - Added Bitmap::find_first_bit() - Added timings to join_cache for ANALYZE table (patch by Sergei Petrunia). - Added records_init and records_after_filter to POSITION to remember more of what best_access_patch() calculates. - table_after_join_selectivity() changed to recalculate 'records_out' based on the new fields from best_access_patch() Bug fixes: - Some queries did not update last_query_cost (was 0). Fixed by moving setting thd->...last_query_cost in JOIN::optimize(). - Write '0' as number of rows for const tables with a matching row. Some internals: - Engine cost are stored in OPTIMIZER_COSTS structure. When a handlerton is created, we also created a new cost variable for the handlerton. We also create a new variable if the user changes a optimizer cost for a not yet loaded handlerton either with command line arguments or with SET @@global.engine.optimizer_cost_variable=xx. - There are 3 global OPTIMIZER_COSTS variables: default_optimizer_costs The default costs + changes from the command line without an engine specifier. heap_optimizer_costs Heap table costs, used for temporary tables tmp_table_optimizer_costs The cost for the default on disk internal temporary table (MyISAM or Aria) - The engine cost for a table is stored in table_share. To speed up accesses the handler has a pointer to this. The cost is copied to the table on first access. If one wants to change the cost one must first update the global engine cost and then do a FLUSH TABLES. This was done to be able to access the costs for an open table without any locks. - When a handlerton is created, the cost are updated the following way: See sql/keycaches.cc for details: - Use 'default_optimizer_costs' as a base - Call hton->update_optimizer_costs() to override with the engines default costs. - Override the costs that the user has specified for the engine. - One handler open, copy the engine cost from handlerton to TABLE_SHARE. - Call handler::update_optimizer_costs() to allow the engine to update cost for this particular table. - There are two costs stored in THD. These are copied to the handler when the table is used in a query: - optimizer_where_cost - optimizer_scan_setup_cost - Simply code in best_access_path() by storing all cost result in a structure. (Idea/Suggestion by Igor)
473 lines
16 KiB
Text
473 lines
16 KiB
Text
use INFORMATION_SCHEMA;
|
|
show tables;
|
|
Tables_in_information_schema
|
|
ALL_PLUGINS
|
|
APPLICABLE_ROLES
|
|
CHARACTER_SETS
|
|
CHECK_CONSTRAINTS
|
|
CLIENT_STATISTICS
|
|
COLLATIONS
|
|
COLLATION_CHARACTER_SET_APPLICABILITY
|
|
COLUMNS
|
|
COLUMN_PRIVILEGES
|
|
ENABLED_ROLES
|
|
ENGINES
|
|
EVENTS
|
|
FILES
|
|
GEOMETRY_COLUMNS
|
|
GLOBAL_STATUS
|
|
GLOBAL_VARIABLES
|
|
INDEX_STATISTICS
|
|
INNODB_BUFFER_PAGE
|
|
INNODB_BUFFER_PAGE_LRU
|
|
INNODB_BUFFER_POOL_STATS
|
|
INNODB_CMP
|
|
INNODB_CMPMEM
|
|
INNODB_CMPMEM_RESET
|
|
INNODB_CMP_PER_INDEX
|
|
INNODB_CMP_RESET
|
|
INNODB_LOCKS
|
|
INNODB_LOCK_WAITS
|
|
INNODB_METRICS
|
|
INNODB_SYS_COLUMNS
|
|
INNODB_SYS_FIELDS
|
|
INNODB_SYS_FOREIGN
|
|
INNODB_SYS_FOREIGN_COLS
|
|
INNODB_SYS_INDEXES
|
|
INNODB_SYS_TABLES
|
|
INNODB_SYS_TABLESTATS
|
|
INNODB_SYS_VIRTUAL
|
|
INNODB_TABLESPACES_ENCRYPTION
|
|
INNODB_TRX
|
|
KEYWORDS
|
|
KEY_CACHES
|
|
KEY_COLUMN_USAGE
|
|
OPTIMIZER_COSTS
|
|
OPTIMIZER_TRACE
|
|
PARAMETERS
|
|
PARTITIONS
|
|
PLUGINS
|
|
PROCESSLIST
|
|
PROFILING
|
|
REFERENTIAL_CONSTRAINTS
|
|
ROUTINES
|
|
SCHEMATA
|
|
SCHEMA_PRIVILEGES
|
|
SESSION_STATUS
|
|
SESSION_VARIABLES
|
|
SPATIAL_REF_SYS
|
|
SQL_FUNCTIONS
|
|
STATISTICS
|
|
SYSTEM_VARIABLES
|
|
TABLES
|
|
TABLESPACES
|
|
TABLE_CONSTRAINTS
|
|
TABLE_PRIVILEGES
|
|
TABLE_STATISTICS
|
|
TRIGGERS
|
|
USER_PRIVILEGES
|
|
USER_STATISTICS
|
|
VIEWS
|
|
SELECT t.table_name, c1.column_name
|
|
FROM information_schema.tables t
|
|
INNER JOIN
|
|
information_schema.columns c1
|
|
ON t.table_schema = c1.table_schema AND
|
|
t.table_name = c1.table_name
|
|
WHERE t.table_schema = 'information_schema' AND
|
|
c1.ordinal_position =
|
|
( SELECT COALESCE(MIN(c2.ordinal_position),1)
|
|
FROM information_schema.columns c2
|
|
WHERE c2.table_schema = t.table_schema AND
|
|
c2.table_name = t.table_name AND
|
|
c2.column_name LIKE '%SCHEMA%'
|
|
) order by t.table_name;
|
|
table_name column_name
|
|
ALL_PLUGINS PLUGIN_NAME
|
|
APPLICABLE_ROLES GRANTEE
|
|
CHARACTER_SETS CHARACTER_SET_NAME
|
|
CHECK_CONSTRAINTS CONSTRAINT_SCHEMA
|
|
CLIENT_STATISTICS CLIENT
|
|
COLLATIONS COLLATION_NAME
|
|
COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
|
|
COLUMNS TABLE_SCHEMA
|
|
COLUMN_PRIVILEGES TABLE_SCHEMA
|
|
ENABLED_ROLES ROLE_NAME
|
|
ENGINES ENGINE
|
|
EVENTS EVENT_SCHEMA
|
|
FILES TABLE_SCHEMA
|
|
GEOMETRY_COLUMNS F_TABLE_SCHEMA
|
|
GLOBAL_STATUS VARIABLE_NAME
|
|
GLOBAL_VARIABLES VARIABLE_NAME
|
|
INDEX_STATISTICS TABLE_SCHEMA
|
|
INNODB_BUFFER_PAGE POOL_ID
|
|
INNODB_BUFFER_PAGE_LRU POOL_ID
|
|
INNODB_BUFFER_POOL_STATS POOL_ID
|
|
INNODB_CMP page_size
|
|
INNODB_CMPMEM page_size
|
|
INNODB_CMPMEM_RESET page_size
|
|
INNODB_CMP_PER_INDEX database_name
|
|
INNODB_CMP_RESET page_size
|
|
INNODB_LOCKS lock_id
|
|
INNODB_LOCK_WAITS requesting_trx_id
|
|
INNODB_METRICS NAME
|
|
INNODB_SYS_COLUMNS TABLE_ID
|
|
INNODB_SYS_FIELDS INDEX_ID
|
|
INNODB_SYS_FOREIGN ID
|
|
INNODB_SYS_FOREIGN_COLS ID
|
|
INNODB_SYS_INDEXES INDEX_ID
|
|
INNODB_SYS_TABLES TABLE_ID
|
|
INNODB_SYS_TABLESTATS TABLE_ID
|
|
INNODB_SYS_VIRTUAL TABLE_ID
|
|
INNODB_TABLESPACES_ENCRYPTION SPACE
|
|
INNODB_TRX trx_id
|
|
KEYWORDS WORD
|
|
KEY_CACHES KEY_CACHE_NAME
|
|
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
|
|
OPTIMIZER_COSTS ENGINE
|
|
OPTIMIZER_TRACE QUERY
|
|
PARAMETERS SPECIFIC_SCHEMA
|
|
PARTITIONS TABLE_SCHEMA
|
|
PLUGINS PLUGIN_NAME
|
|
PROCESSLIST ID
|
|
PROFILING QUERY_ID
|
|
REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
|
|
ROUTINES ROUTINE_SCHEMA
|
|
SCHEMATA SCHEMA_NAME
|
|
SCHEMA_PRIVILEGES TABLE_SCHEMA
|
|
SESSION_STATUS VARIABLE_NAME
|
|
SESSION_VARIABLES VARIABLE_NAME
|
|
SPATIAL_REF_SYS SRID
|
|
SQL_FUNCTIONS FUNCTION
|
|
STATISTICS TABLE_SCHEMA
|
|
SYSTEM_VARIABLES VARIABLE_NAME
|
|
TABLES TABLE_SCHEMA
|
|
TABLESPACES TABLESPACE_NAME
|
|
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
|
|
TABLE_PRIVILEGES TABLE_SCHEMA
|
|
TABLE_STATISTICS TABLE_SCHEMA
|
|
TRIGGERS TRIGGER_SCHEMA
|
|
USER_PRIVILEGES GRANTEE
|
|
USER_STATISTICS USER
|
|
VIEWS TABLE_SCHEMA
|
|
SELECT t.table_name, c1.column_name
|
|
FROM information_schema.tables t
|
|
INNER JOIN
|
|
information_schema.columns c1
|
|
ON t.table_schema = c1.table_schema AND
|
|
t.table_name = c1.table_name
|
|
WHERE t.table_schema = 'information_schema' AND
|
|
c1.ordinal_position =
|
|
( SELECT COALESCE(MIN(c2.ordinal_position),1)
|
|
FROM information_schema.columns c2
|
|
WHERE c2.table_schema = 'information_schema' AND
|
|
c2.table_name = t.table_name AND
|
|
c2.column_name LIKE '%SCHEMA%'
|
|
) order by t.table_name;
|
|
table_name column_name
|
|
ALL_PLUGINS PLUGIN_NAME
|
|
APPLICABLE_ROLES GRANTEE
|
|
CHARACTER_SETS CHARACTER_SET_NAME
|
|
CHECK_CONSTRAINTS CONSTRAINT_SCHEMA
|
|
CLIENT_STATISTICS CLIENT
|
|
COLLATIONS COLLATION_NAME
|
|
COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
|
|
COLUMNS TABLE_SCHEMA
|
|
COLUMN_PRIVILEGES TABLE_SCHEMA
|
|
ENABLED_ROLES ROLE_NAME
|
|
ENGINES ENGINE
|
|
EVENTS EVENT_SCHEMA
|
|
FILES TABLE_SCHEMA
|
|
GEOMETRY_COLUMNS F_TABLE_SCHEMA
|
|
GLOBAL_STATUS VARIABLE_NAME
|
|
GLOBAL_VARIABLES VARIABLE_NAME
|
|
INDEX_STATISTICS TABLE_SCHEMA
|
|
INNODB_BUFFER_PAGE POOL_ID
|
|
INNODB_BUFFER_PAGE_LRU POOL_ID
|
|
INNODB_BUFFER_POOL_STATS POOL_ID
|
|
INNODB_CMP page_size
|
|
INNODB_CMPMEM page_size
|
|
INNODB_CMPMEM_RESET page_size
|
|
INNODB_CMP_PER_INDEX database_name
|
|
INNODB_CMP_RESET page_size
|
|
INNODB_LOCKS lock_id
|
|
INNODB_LOCK_WAITS requesting_trx_id
|
|
INNODB_METRICS NAME
|
|
INNODB_SYS_COLUMNS TABLE_ID
|
|
INNODB_SYS_FIELDS INDEX_ID
|
|
INNODB_SYS_FOREIGN ID
|
|
INNODB_SYS_FOREIGN_COLS ID
|
|
INNODB_SYS_INDEXES INDEX_ID
|
|
INNODB_SYS_TABLES TABLE_ID
|
|
INNODB_SYS_TABLESTATS TABLE_ID
|
|
INNODB_SYS_VIRTUAL TABLE_ID
|
|
INNODB_TABLESPACES_ENCRYPTION SPACE
|
|
INNODB_TRX trx_id
|
|
KEYWORDS WORD
|
|
KEY_CACHES KEY_CACHE_NAME
|
|
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
|
|
OPTIMIZER_COSTS ENGINE
|
|
OPTIMIZER_TRACE QUERY
|
|
PARAMETERS SPECIFIC_SCHEMA
|
|
PARTITIONS TABLE_SCHEMA
|
|
PLUGINS PLUGIN_NAME
|
|
PROCESSLIST ID
|
|
PROFILING QUERY_ID
|
|
REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
|
|
ROUTINES ROUTINE_SCHEMA
|
|
SCHEMATA SCHEMA_NAME
|
|
SCHEMA_PRIVILEGES TABLE_SCHEMA
|
|
SESSION_STATUS VARIABLE_NAME
|
|
SESSION_VARIABLES VARIABLE_NAME
|
|
SPATIAL_REF_SYS SRID
|
|
SQL_FUNCTIONS FUNCTION
|
|
STATISTICS TABLE_SCHEMA
|
|
SYSTEM_VARIABLES VARIABLE_NAME
|
|
TABLES TABLE_SCHEMA
|
|
TABLESPACES TABLESPACE_NAME
|
|
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
|
|
TABLE_PRIVILEGES TABLE_SCHEMA
|
|
TABLE_STATISTICS TABLE_SCHEMA
|
|
TRIGGERS TRIGGER_SCHEMA
|
|
USER_PRIVILEGES GRANTEE
|
|
USER_STATISTICS USER
|
|
VIEWS TABLE_SCHEMA
|
|
select 1 as "must be 1" from information_schema.tables where "ACCOUNTS"=
|
|
(select cast(table_name as char) from information_schema.tables
|
|
order by table_name limit 1) limit 1;
|
|
must be 1
|
|
1
|
|
select t.table_name, group_concat(t.table_schema, '.', t.table_name),
|
|
count(*) as num1
|
|
from information_schema.tables t
|
|
inner join information_schema.columns c1
|
|
on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
|
|
where t.table_schema = 'information_schema' and
|
|
c1.ordinal_position =
|
|
(select isnull(c2.column_type) -
|
|
isnull(group_concat(c2.table_schema, '.', c2.table_name)) +
|
|
count(*) as num
|
|
from information_schema.columns c2 where
|
|
c2.table_schema='information_schema' and
|
|
(c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)')
|
|
group by c2.column_type order by num limit 1)
|
|
group by t.table_name order by num1, t.table_name;
|
|
table_name group_concat(t.table_schema, '.', t.table_name) num1
|
|
ALL_PLUGINS information_schema.ALL_PLUGINS 1
|
|
APPLICABLE_ROLES information_schema.APPLICABLE_ROLES 1
|
|
CHARACTER_SETS information_schema.CHARACTER_SETS 1
|
|
CHECK_CONSTRAINTS information_schema.CHECK_CONSTRAINTS 1
|
|
CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1
|
|
COLLATIONS information_schema.COLLATIONS 1
|
|
COLLATION_CHARACTER_SET_APPLICABILITY information_schema.COLLATION_CHARACTER_SET_APPLICABILITY 1
|
|
COLUMNS information_schema.COLUMNS 1
|
|
COLUMN_PRIVILEGES information_schema.COLUMN_PRIVILEGES 1
|
|
ENGINES information_schema.ENGINES 1
|
|
EVENTS information_schema.EVENTS 1
|
|
FILES information_schema.FILES 1
|
|
GEOMETRY_COLUMNS information_schema.GEOMETRY_COLUMNS 1
|
|
GLOBAL_STATUS information_schema.GLOBAL_STATUS 1
|
|
GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
|
|
INDEX_STATISTICS information_schema.INDEX_STATISTICS 1
|
|
INNODB_BUFFER_PAGE information_schema.INNODB_BUFFER_PAGE 1
|
|
INNODB_BUFFER_PAGE_LRU information_schema.INNODB_BUFFER_PAGE_LRU 1
|
|
INNODB_BUFFER_POOL_STATS information_schema.INNODB_BUFFER_POOL_STATS 1
|
|
INNODB_CMP information_schema.INNODB_CMP 1
|
|
INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
|
|
INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
|
|
INNODB_CMP_PER_INDEX information_schema.INNODB_CMP_PER_INDEX 1
|
|
INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
|
|
INNODB_LOCKS information_schema.INNODB_LOCKS 1
|
|
INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
|
|
INNODB_METRICS information_schema.INNODB_METRICS 1
|
|
INNODB_SYS_COLUMNS information_schema.INNODB_SYS_COLUMNS 1
|
|
INNODB_SYS_FIELDS information_schema.INNODB_SYS_FIELDS 1
|
|
INNODB_SYS_FOREIGN information_schema.INNODB_SYS_FOREIGN 1
|
|
INNODB_SYS_FOREIGN_COLS information_schema.INNODB_SYS_FOREIGN_COLS 1
|
|
INNODB_SYS_INDEXES information_schema.INNODB_SYS_INDEXES 1
|
|
INNODB_SYS_TABLES information_schema.INNODB_SYS_TABLES 1
|
|
INNODB_SYS_TABLESTATS information_schema.INNODB_SYS_TABLESTATS 1
|
|
INNODB_SYS_VIRTUAL information_schema.INNODB_SYS_VIRTUAL 1
|
|
INNODB_TABLESPACES_ENCRYPTION information_schema.INNODB_TABLESPACES_ENCRYPTION 1
|
|
INNODB_TRX information_schema.INNODB_TRX 1
|
|
KEY_CACHES information_schema.KEY_CACHES 1
|
|
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
|
|
OPTIMIZER_COSTS information_schema.OPTIMIZER_COSTS 1
|
|
OPTIMIZER_TRACE information_schema.OPTIMIZER_TRACE 1
|
|
PARAMETERS information_schema.PARAMETERS 1
|
|
PARTITIONS information_schema.PARTITIONS 1
|
|
PLUGINS information_schema.PLUGINS 1
|
|
PROCESSLIST information_schema.PROCESSLIST 1
|
|
PROFILING information_schema.PROFILING 1
|
|
REFERENTIAL_CONSTRAINTS information_schema.REFERENTIAL_CONSTRAINTS 1
|
|
ROUTINES information_schema.ROUTINES 1
|
|
SCHEMATA information_schema.SCHEMATA 1
|
|
SCHEMA_PRIVILEGES information_schema.SCHEMA_PRIVILEGES 1
|
|
SESSION_STATUS information_schema.SESSION_STATUS 1
|
|
SESSION_VARIABLES information_schema.SESSION_VARIABLES 1
|
|
SPATIAL_REF_SYS information_schema.SPATIAL_REF_SYS 1
|
|
STATISTICS information_schema.STATISTICS 1
|
|
SYSTEM_VARIABLES information_schema.SYSTEM_VARIABLES 1
|
|
TABLES information_schema.TABLES 1
|
|
TABLESPACES information_schema.TABLESPACES 1
|
|
TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
|
|
TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
|
|
TABLE_STATISTICS information_schema.TABLE_STATISTICS 1
|
|
TRIGGERS information_schema.TRIGGERS 1
|
|
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
|
|
USER_STATISTICS information_schema.USER_STATISTICS 1
|
|
VIEWS information_schema.VIEWS 1
|
|
+---------------------------------------+
|
|
+---------------------------------------+
|
|
+---------------------------------------+
|
|
Database: information_schema
|
|
| Tables |
|
|
| ALL_PLUGINS |
|
|
| APPLICABLE_ROLES |
|
|
| CHARACTER_SETS |
|
|
| CHECK_CONSTRAINTS |
|
|
| CLIENT_STATISTICS |
|
|
| COLLATIONS |
|
|
| COLLATION_CHARACTER_SET_APPLICABILITY |
|
|
| COLUMNS |
|
|
| COLUMN_PRIVILEGES |
|
|
| ENABLED_ROLES |
|
|
| ENGINES |
|
|
| EVENTS |
|
|
| FILES |
|
|
| GEOMETRY_COLUMNS |
|
|
| GLOBAL_STATUS |
|
|
| GLOBAL_VARIABLES |
|
|
| INDEX_STATISTICS |
|
|
| INNODB_BUFFER_PAGE |
|
|
| INNODB_BUFFER_PAGE_LRU |
|
|
| INNODB_BUFFER_POOL_STATS |
|
|
| INNODB_CMP |
|
|
| INNODB_CMPMEM |
|
|
| INNODB_CMPMEM_RESET |
|
|
| INNODB_CMP_PER_INDEX |
|
|
| INNODB_CMP_RESET |
|
|
| INNODB_LOCKS |
|
|
| INNODB_LOCK_WAITS |
|
|
| INNODB_METRICS |
|
|
| INNODB_SYS_COLUMNS |
|
|
| INNODB_SYS_FIELDS |
|
|
| INNODB_SYS_FOREIGN |
|
|
| INNODB_SYS_FOREIGN_COLS |
|
|
| INNODB_SYS_INDEXES |
|
|
| INNODB_SYS_TABLES |
|
|
| INNODB_SYS_TABLESTATS |
|
|
| INNODB_SYS_VIRTUAL |
|
|
| INNODB_TABLESPACES_ENCRYPTION |
|
|
| INNODB_TRX |
|
|
| KEYWORDS |
|
|
| KEY_CACHES |
|
|
| KEY_COLUMN_USAGE |
|
|
| OPTIMIZER_COSTS |
|
|
| OPTIMIZER_TRACE |
|
|
| PARAMETERS |
|
|
| PARTITIONS |
|
|
| PLUGINS |
|
|
| PROCESSLIST |
|
|
| PROFILING |
|
|
| REFERENTIAL_CONSTRAINTS |
|
|
| ROUTINES |
|
|
| SCHEMATA |
|
|
| SCHEMA_PRIVILEGES |
|
|
| SESSION_STATUS |
|
|
| SESSION_VARIABLES |
|
|
| SPATIAL_REF_SYS |
|
|
| SQL_FUNCTIONS |
|
|
| STATISTICS |
|
|
| SYSTEM_VARIABLES |
|
|
| TABLES |
|
|
| TABLESPACES |
|
|
| TABLE_CONSTRAINTS |
|
|
| TABLE_PRIVILEGES |
|
|
| TABLE_STATISTICS |
|
|
| TRIGGERS |
|
|
| USER_PRIVILEGES |
|
|
| USER_STATISTICS |
|
|
| VIEWS |
|
|
+---------------------------------------+
|
|
+---------------------------------------+
|
|
+---------------------------------------+
|
|
Database: INFORMATION_SCHEMA
|
|
| Tables |
|
|
| ALL_PLUGINS |
|
|
| APPLICABLE_ROLES |
|
|
| CHARACTER_SETS |
|
|
| CHECK_CONSTRAINTS |
|
|
| CLIENT_STATISTICS |
|
|
| COLLATIONS |
|
|
| COLLATION_CHARACTER_SET_APPLICABILITY |
|
|
| COLUMNS |
|
|
| COLUMN_PRIVILEGES |
|
|
| ENABLED_ROLES |
|
|
| ENGINES |
|
|
| EVENTS |
|
|
| FILES |
|
|
| GEOMETRY_COLUMNS |
|
|
| GLOBAL_STATUS |
|
|
| GLOBAL_VARIABLES |
|
|
| INDEX_STATISTICS |
|
|
| INNODB_BUFFER_PAGE |
|
|
| INNODB_BUFFER_PAGE_LRU |
|
|
| INNODB_BUFFER_POOL_STATS |
|
|
| INNODB_CMP |
|
|
| INNODB_CMPMEM |
|
|
| INNODB_CMPMEM_RESET |
|
|
| INNODB_CMP_PER_INDEX |
|
|
| INNODB_CMP_RESET |
|
|
| INNODB_LOCKS |
|
|
| INNODB_LOCK_WAITS |
|
|
| INNODB_METRICS |
|
|
| INNODB_SYS_COLUMNS |
|
|
| INNODB_SYS_FIELDS |
|
|
| INNODB_SYS_FOREIGN |
|
|
| INNODB_SYS_FOREIGN_COLS |
|
|
| INNODB_SYS_INDEXES |
|
|
| INNODB_SYS_TABLES |
|
|
| INNODB_SYS_TABLESTATS |
|
|
| INNODB_SYS_VIRTUAL |
|
|
| INNODB_TABLESPACES_ENCRYPTION |
|
|
| INNODB_TRX |
|
|
| KEYWORDS |
|
|
| KEY_CACHES |
|
|
| KEY_COLUMN_USAGE |
|
|
| OPTIMIZER_COSTS |
|
|
| OPTIMIZER_TRACE |
|
|
| PARAMETERS |
|
|
| PARTITIONS |
|
|
| PLUGINS |
|
|
| PROCESSLIST |
|
|
| PROFILING |
|
|
| REFERENTIAL_CONSTRAINTS |
|
|
| ROUTINES |
|
|
| SCHEMATA |
|
|
| SCHEMA_PRIVILEGES |
|
|
| SESSION_STATUS |
|
|
| SESSION_VARIABLES |
|
|
| SPATIAL_REF_SYS |
|
|
| SQL_FUNCTIONS |
|
|
| STATISTICS |
|
|
| SYSTEM_VARIABLES |
|
|
| TABLES |
|
|
| TABLESPACES |
|
|
| TABLE_CONSTRAINTS |
|
|
| TABLE_PRIVILEGES |
|
|
| TABLE_STATISTICS |
|
|
| TRIGGERS |
|
|
| USER_PRIVILEGES |
|
|
| USER_STATISTICS |
|
|
| VIEWS |
|
|
+--------------------+
|
|
+--------------------+
|
|
+--------------------+
|
|
Wildcard: inf_rmation_schema
|
|
| Databases |
|
|
| information_schema |
|
|
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
|
|
table_schema count(*)
|
|
information_schema 67
|
|
mysql 31
|