June 19, 2013

Post: Implementing SchemaSpy in your MySQL environment

…a schema in a databasedatabase to see which tables are referenced the most, and which are candidates for droppingMySQL driver=com.mysql.jdbc.Driver connectionSpec=jdbc:mysql://127.0.0.1:5610/schemaspy driverPath=/usr/share/java/mysql-connector-java.jar Example Schema…port or schema name information….

Post: MySQL 5.6 vs MySQL 5.5 and the Star Schema Benchmark

mysql> select * from information_schema.innodb_buffer_pool_stats\G *************************** 1. row *************************** POOL_ID: 0 POOL_SIZE: 8191 FREE_BUFFERS: 1024 DATABASE_PAGES: 7162 OLD_DATABASE…d_year, s_city, p_brand; And the schema: DROP TABLE IF EXISTS customer; CREATE TABLE IF NOT…

Post: Quickly finding unused indexes (and estimating their size)

… their database size on disk quickly without a lot of messy schema redesign and application recoding.  They didn’t want to drop any… use that information: mysql> drop view if exists droppable_indexes; mysql> create view droppable_indexes as select all_indexes.table_schema as table_schema, all_indexes…

Post: Find unused indexes

database. To accomplish our task of finding unused indexes we’re going to use INFORMATION_SCHEMA.INDEX_STATISTICS but first we should enable User Statistics: mysql> SET GLOBAL…– type:non-unique ALTER TABLE `tpcc`.`orders` DROP KEY `idx_orders`; — type:non-unique ALTER…

Post: How Percona does a MySQL Performance Audit

… see what’s up with the database. The first step is to find out what MySQL instances are on the machine. It… server is not heavily loaded, I may even do some INFORMATION_SCHEMA queries to help me find the biggest tables and so… whose .frm files exist but have been dropped from InnoDB, for example. (The INFORMATION_SCHEMA query will surely trigger errors about this.) There…

Post: InnoDB Full-text Search in MySQL 5.6 (part 1)

database directory: -rw-rw—-. 1 mysql mysql 8632 Feb 20 15:54 dir_test_innodb.frm -rw-rw—-. 1 mysql mysqlmysql> set global innodb_ft_aux_table=’test/dir_test_innodb’; mysql> set global innodb_optimize_fulltext_only=1; mysql> select * from information_schema

Post: Connecting orphaned .ibd files

… methods. The first is create/drop the table many times until …user(you can see them in information_scheme database in Percona Server though). …mysql> select * from `INNODB_SYS_TABLES` where `SCHEMA` = ‘sakila’ AND `NAME` = ‘actor’G *************************** 1. row *************************** SCHEMA

Post: MySQL extensions for hosting

… at all and could be candidates for dropping. All the patch features will surely be …. With simple MySQL SHOW command it gives you the basic statistics on the database activity broken … users to see their own statistics only information_schema support to allow SELECT query transformations, joins …

Post: InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!

…we’re trying to emulate: mysql: SHOW CREATE TABLE information_schema.innodb_ft_default_stopword\G *************************** 1….database, and I used double quotes to group the search terms as a single phrase: With 5.5: mysql… to 1, dropped/rebuilt the InnoDB index, and tried again. mysql: SELECT id,…

Comment: Duplicate indexes and redundant indexes

information_schema.table_constraints a INNER JOIN information_schema.key_column_usage b ON a.constraint_name = b.constraint_name AND a.table_schema