Yabomsat!
Yet Another Blog On MySQL® Server Administration, monitoring and Tuning!

MySQL™ European Customer Conferences 2008

July 31, 2008 - 4:55 pm - by Santo Leto

There will be 3 conferences in Europe for Customers and Users:

As usual there is an early bird discount if you register until August 31st.

More details on http://www.mysql.com/news-and-events/european-conferences/2008/.

I will attend the Central Europe Conference, barring accidents. Here’s a map from Google™:


View Larger Map

To be honest, I got some difficulties some weeks ago when I registered because the registration page wasn’t entirely translated in English and, despite I would learn it, I don’t understand German :(

Same problem when I tried to read the Agenda in more details… (Why don’t you translate it in English too?)

Feel free to post a comment if you are from Italy, Slovenia or Croatia and you would like to attend the Central Europe Conference too. We can meet in Trieste to head together to Germany : )

See you there!


Vista™, Virtual Box, Solaris™ 10, MySQL™ Cluster

July 22, 2008 - 4:27 am - by Santo Leto

..aka how to spend a magnificent Sunday-Monday in SUN’s company :)

If your applications run on Windows™ and you need a MySQL™ Cluster for testing purposes you can use Virtual Box to install SUN Solaris™  10 and set up the Database Cluster creating 4 Solaris™ Zones (4 IP are required for a minimal Cluster setup).

It’s an interesting scenario.

You will need:

You can create the Solaris™ Zones manually or you can create them at once using a script file.

Note that you don’t need to install 4 Operating Systems. You’ll install 1 Solaris™ 10 and then 4 Zones, each with a different IP: one for the MGT Node, one for the SQL Node, one for the Data Node 1 and one for the Data Node 2.

To get started with Solaris™ Zones, I followed a very useful article by a Sun blogger - “Setting up MySQL Cluster using Solaris Zone”.

Unfortunately, after setting up Solaris™ 10 and the Database Cluster I was not able to connect through SSH to the SQL Node from my Vista™ machine, thus my Cluster was up, running but isolated and unreachable as well :(

After a long pause I got the idea for the solution of the issue (it’s typical): I forgot the configuration of port forwarding with NAT in the Solaris™ 10 Guest System.

…The disadvantage of NAT mode is that, much like a private network behind a router, the virtual machine is invisible and unreachable from the outside internet; you cannot run a server this way unless you set up port forwarding..

ummh.. always RTFM (and check it again, and again…)!

I set up the port forwarding with the commands:

C:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe setextradata “Solaris-10″ “VB
oxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol” TCP
VirtualBox Command Line Management Interface Version 1.6.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

C:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe setextradata “Solaris-10″ “VB
oxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort” 22
VirtualBox Command Line Management Interface Version 1.6.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

C:\Program Files\Sun\xVM VirtualBox>VBoxManage.exe setextradata “Solaris-10″ “VB
oxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort” 2222
VirtualBox Command Line Management Interface Version 1.6.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

However since making this change the Solaris™ Guest did not start anymore and I got the following error:

Configuration error: Failed to get the “MAC” value.
VBox status code: -2103 (VERR_CFGM_VALUE_NOT_FOUND).

I found some posts - like this  - but they didn’t help me.

Conclusion: it’s 4:20 am and I am still looking for a solution to get my Cluster reachable, wondering why I want to use Solaris™ before attending an intensive SUN Training ;-)

I really want to figure out why if I set up the port forwarding for SSH Connections the Guest does not start.. but.. I’d go to bed ;-)

I’ll try to comment in the next days after getting help from VB guru :)


New Competition for MySQL’ers

July 18, 2008 - 11:40 pm - by Santo Leto

I hear now about a new competition for the MySQL® Users. The ‘MySQL® 5.1 Use Case Competition’ has been just launched by the Community Team @ SUN|MySQL.

mysql_51_competition_small.jpg

If you submit a MySQL® 5.1 Use Case Report to the Community Team by 31 August 2008 you will have a chance of winning:

  • 1st-3rd prize: A MySQL Conference & Expo 2009 Pass, including a dinner with MySQL co-founder Michael “Monty” Widenius
  • 4th-10th prize: MySQL® Community Contributor T-shirts
  • 11th-20th prize: A Sakila mascot (MySQL®’s pet dolphin)

More information at http://forge.mysql.com/wiki/MySQL_5_1_Use_Case_Competition.

[Reminder for the Community Team: the page http://forge.mysql.com/wiki/FullContributorsList should be updated.]


Performance Monitoring, Tuning & Auditing in MySQL® 5.1 - A GUI Approach - PART 1

July 18, 2008 - 9:26 pm - by Santo Leto

Revision: 8 - Last Update: September 03 2008

This is the first part of a series of short articles with a how-to approach about MySQL® Performance Monitoring, Tuning & Auditing. We will see the question from a GUI prospective. In particular we will describe which monitoring-oriented features HoneyMonitor, a GUI for MySQL® currently in alpha development, implements.

I will explain how HoneyMonitor let you

  1. install an audit database on your server, without the need of using 3th Party Agents nor using remote repository databases
  2. enable the auditing and start monitoring your server
  3. tuning your server changing a few suggested list of variables to get better performance.

We will use only the 5.1.x series of the Server as we use some Scheduled Events and the Event Scheduler has been added only in the 5.1 branch. In particular we will use MySQL® 5.1.24-rc. We will also do some tests on the 5.1.23-alpha-maria preview and MySQL® 6.0.4-alpha.

As regard HoneyMonitor, we will use the latest alpha version, i.e. 1.0.13-alpha.

Requirements:

  1. a MySQL® Server v. 5.1. - no matter of the platform it is running on - with a user with basic privileges (like create database or create and execute routines)
  2. a Windows® XP® or Vista® client - where we can install HoneyMonitor.

In this article I will not explain the meaning of the performance variables and metrics. There are several Guides available on the web to get more information about the Derived Performance Metrics. Of course, the first step is to browse the MySQL® Documentation. By the way, you can read all the Ratio’s formulas, as well the description of the MySQL® system and status variables, directly from HoneyMonitor.

You can read more on HoneyMonitor, at the project’s page - www.honeysoftware.com/products/honeymonitor - and for any question you can write me directly at sales@honeysoftware.com.

Contents:

  • Downloading & Installing HoneyMonitor
  • First start of HoneyMonitor: Edition Choosing, Software Registration, CEIP, Connection Creation
  • Introduction to the Performance Audit System
  • Installing the Audit Database & Enabling the Auditing
  • Audit Options & Audit Statistics
  • Conclusion
  • What we will see in the next article
  • Other Resources
  • About the Author

1. Downloading & Installing HoneyMonitor

You can download HoneyMonitor at http://www.honeysoftware.com/download. After the download just unzip the file in a temporary folder and run the Installation Wizard.

Honeymonitor uses direct connection to the Server but for some features it also needs the MyODBC driver. If you haven’t that driver installed on your system, you can install it using the HoneyMonitor’s Installation Wizard.

2. First start of HoneyMonitor: Edition Choosing, Software Registration, CEIP, Connection Creation

After installation the icon ‘HoneyMonitor - Welcome’ is created on your Desktop. As the Installation Wizard installs all the available HoneyMonitor’s Editions (Lite Free, Standard, Enterprise, Network, Pro, Audit Pro), the HoneyMonitor - Welcome Window (Fig. 1) allows you to choose the Edition you want to start.

Let’s click on the ‘HoneyMonitor - Welcome’ icon and choose the Audit Pro Edition. For more information about the HoneyMonitor Editions’ Logic, please refer to the page Editions & Features Matrix of the HoneySoftware Web Site.

HoneyMonitor requires a free web registration. The first time you run the software, a Registration Window will appear (Fig. 2).

To register your copy you can follow the instructions reported in that Window and when you get your Web Key, just past it in the Registration Window and click on the ‘Ok’ button.

After Registration, the Trial Period Information Window should appear (Fig. 3). This is just to inform that you are using a 30-days Trial software. You can click on the ‘Next’ button.

If this is the first time you are running HoneyMonitor, the Customer Experience Improvement Program Window should appear (Fig. 4). You can decide to join the Program and anonymously partecipate to help us improve our software. Wheter decision you take, click on the ‘Ok’ button to go on.

Fig. 1: HoneyMonitor Welcome Window

 Fig. 2: HoneyMonitor Registration Window

 Fig. 3: Trial Period Information Window

 Fig. 4: CEIP Window

You are now ready to create a connection to the MySQL® Server (Fig. 5). HoneyMonitor can save your connection’s parameters so that the next time you will use the software you will be able to open that connection just double-clicking on its name from the Server Object List or selecting it using the ‘Stored Connection’ combo-list of the Connection Window.

 Fig. 5: New MySQL® Connection

To create a new connection, insert the Server Hostname (or IP Address), the Port the server is listening on, your Username and your Password. Then do a check clicking on the ‘Test Connection’ button. If the connection was succesfully established, just click on the ‘Connect’ button. The Connection Window will be closed and you are ready to use the connection just created.

Of course, you can create as many connections as you need. For more information about connections creation in HoneyMonitor - included instructions on how to create SSH Tunneling Connections or SSL Connections - please refer to the HoneyMonitor’s Getting Starting Guide.

3. Introduction to the Performance Audit System

The connection to the Server has now been established and we are ready to install the performance audit system and start collecting data.

As we will see more in details in other articles of this series, HoneyMonitor includes a Performance Tuning Monitor. When used in the Pro Edition, the Performance Tuning Monitor is just a static monitor: when you open it (or you use its refresh button) it calculates the most common Performance Hit Ratios and Derived Performance Metrics. When used in HoneyMonitor Audit Pro or HoneyMonitor Network Edition, it not also calculates the Ratios but also gives you the possibility to create time-trend charts of those Ratios so that you can see how the performance of your Server are changing over the time. This could be very useful to identify why, for example, your server’s performance is going worse.

The Performance Tuning Monitor, as well the Audit Report Generation Window reads audit data from an audit database - created on your MySQL® Server by the Audit Installation Wizard. Audit data are hence stored on your server rather than on an external repository database server and this gives you full access to the audit data: you can see them or delete them simply when you want.

Audit data are stored in you server by a Scheduled Event. A Scheduled Event simply is a temporal trigger: you define a time interval (when installing the Audit System, or later using the Audit Options Window) and the Event takes care of calculating all the Performance Hit Ratios and Derived Performance Metrics and stores them in the audit database, so that the data can be used for charts’ creation.

At any time you can change the time interval for the data acquisition or pausing the audit Event so that no other data will be stored until you will enabled the audit Event once again.

As a Populating Event takes care of storing audit data, a Pruning Event takes care of deleting old audit data. You can set the interval for data pruning or simply choose not to prune audit data.

HoneyMonitor doesn’t require third party agents running on your Server, nor cron jobs. It simply use SQL. You don’t need to install - and maintain - software on your servers: all the administration tasks, performance monitoring, tuning and report generation is made at client-side!

Once you create a Performance Report, you can save it in the directory you prefer, print it and export it to pdf or other formats.

HoneyMonitor comes with 90+ performance charts, included in 10 Reports (Temporary Tables, Query Cache, InnoDB, …) but you can also create the Reports you prefer using the included Report Designer.

3.1. Replication Issues

If your server is a Master Server, you must skip the replication of the audit database otherwise the performance audit data of the master will be replicated on the slaves.

Option -replicate-ignore-table=db_name.tbl_name should avoid this problem. Please refer to the MySQL® Reference Manual for further information on replication.

You can monitor your master / slaves environment simply installing the audit database on the master and on each slave.

4. Installing the Audit Database & Enabling the Auditing

To start Audit Installation just click on the menu Auditing / Install Audit and follow the few steps of Audit Installation Wizard. A database named hs_audit_schema will be created. Please make sure that you don’t have a database with the same name as, at the moment, there is no possibilities to change the name of the audit database installed by the software. During installation, the Wizard will perform some tests to ensure that all is installed propertly and also allows you to set the events’ intervals and enable data collection (Fig. from 6 to 9).

 Fig. 6: Audit Installation Wizard (1 of 4)

 Fig. 7: Audit Installation Wizard (2 of 4)

 Fig. 8: Audit Installation Wizard (3 of 4)

 Fig. 9: Audit Installation Wizard (4 of 4)

By the way at any time you can open the Check Audit Installation Window to check the status of your Audit System.

Fig. 10: Check Audit Installation Window

5. Audit Options & Audit Statistics

By default, the Audit Installation Wizard, after installation, enables the auditing. If you have paused it, to enable it once again, just open the Audit Options Window (Fig. 11) and check the Enable Populating Event check-box.

You may be interested knowing how many records the Audit Table contains or how many disk space is being used. If you click on the Auditing / Audit Statistics menu, the Audit Statistics Window (Fig. 12) will be opened and you’ll can see some statistics on your Audit Database.

 Fig. 11: Audit Options

 Fig. 12: Audit Statistics

6. Conclusion

In this first article of the series, we have focused on the first startup of HoneyMonitor and on introducing the Audit System showing you how to get it working.

7. What we will see in the next articles

In the next article of this series, we’ll take a look at the Performance Tuning Monitor and we will see how to create Performance Reports.

The following is a not-complete list of subsections we plan to discuss over the series of articles:

  • Quick Tour of the Performance Tuning Monitor
  • Quick Tour of the Performance Reports
  • The Audit Database in Details
  • Limitations: how the system can be improved
  • Future Plans: which features we plan to add in the Audit Pro Edition
  • A Brief Introduction to other features of HoneyMonitor
    • Quick Tour of the Metadata Catalog
    • Quick Tour of the Replication Monitor
    • Quick Tour of the Cluster Monitor

Contents are subject to change. Let us know what you’d like to see.

8. Other Resources

If you want to learn more on HoneyMonitor please visit the Project Home Page, at http://www.honeysoftware.com/honeymonitor, or check out one of the following resources:

9. About the Author

Santo Leto is a two years experience MySQL® DBA and Developer.
Leader and main programmer of the HoneyMonitor Project, he graduated in physics and he lives in Italy, where he works from home.


RE: A bugs life

July 17, 2008 - 3:45 pm - by Santo Leto

This is a short reply to Michael’s post “A bugs life”.

This bugs are still relevant for me:

  1. Bug #9588 Support for ALTER (or CREATE OR REPLACE) PROCEDURE/FUNCTION <BODY>
  2. Bug #18466 add REPLACE to CREATE FUNCTION, PROCEDURE, TRIGGER
  3. Bug #33455 Can’t retrieve Routine Parameters if the user has limited privileges

In my dreamland they would be fixed before 5.1 reaches GA but I know that probably it is difficult to add such features in a RC version.

Questions. Do you plan to fix them? If yes, can I ask you when?

Thanks.
 


HoneyMonitor Pro and Audit Pro Editions v.1.0.13-alpha released!

July 14, 2008 - 1:22 pm - by Santo Leto
[HoneyMonitor is a MySQLTM GUI Tool for WindowsTM Systems. Server Administration, Database and Database Objects Administration, Code Development, Server Monitoring, Performance Monitoring, Performance Auditing. Read more on http://www.honeysoftware.com]

We are pleased to announce the availability of HoneyMonitor Pro and HoneyMonitor Audit Pro!

Press Release available at:
http://www.honeysoftware.com/news/pressreleases/20080714-honeymonitor-performance-tuning.php.

 HoneyMonitor - Audit Pro Edition

The following is the list of changes:

  • New Features:
    • first public release of the Edition Audit Pro.
    • first public release of the Edition Pro.
    • new performance Audit features:
      • new menu ”Auditing”;
      • installation of a performance audit system (only for Server’s version 5.1.x or higher);
      • performance reports.
    • new Performance Tuning Monitor.
    • new Metadata Catalog.
    • new SHOW Monitor.
    • support for anonymous users.
    • new fast entry ”Line Wrap” in the SQL Editor’s popup menu.
    • User Editor & Change Password Window: a warning is now shown when trying to insert an empty password.
    • new Customer Experience Improvement Program (CEIP)
      • new menu Help / Customer Feedback Options;
      • new CEIP Window.
    • the HoneyMonitor Update Wizard has been deprecated. Now, when starting HoneyMonitor updates are searched on the Web and, if any, a messages is prompt.
    • support for the creation / elimination of the InnoDB Monitors: monitor, lock_monitor,tablespace_monitor, table_monitor.
    • minor changes when clicking on Server / Show… sub-menus.
    • new column ”Command Description” in the ”Process List” lists (Server Properties, ReplicationMonitor, Performance Tuning Monitor).
    • now you can filter the (server) processes by command value, as well by users.
    • first support for the Choose Database Window (for server’s version lesser than 5.0. with the-skip_show_database option enabled).
    • the SQL AssistantTM now supports Users with limited, non-root privileges.
  • Improvements:
    • improvements in the Replication Monitor:
      • the slave status variables now have a description;
      • new icons in the Slaves Tab for a better view of the state (running/not-running) of the replication’s threads (SQL and IO);
      • improvements in the lists’ popup menus;
      • new ”Formatted Value” column in the Master Logs list.
    • improvements in the ”Variables” and ”Status” Tabs of the Server Properties Window:
      • new variables handled (MARIA engine ready);
      • new column ”Formatted Value” (e.g. bytes to KB, MB or GB);
      • improvements in the lists’ popup menus.
    • SQL Syntax Highlighting improvements.
    • improvements and bugs fix in the Create Table Wizard.
    • improvements and bugs fix in the Partition Editor:
      • the Editor is now sizeable;
      • Partition’s Tree: more information are now shown.
    • improvements and bugs fix in the Log Management Window:
      • support for users with limited privileges;
      • new column ”Formatted Value” (e.g. bytes to KB, MB or GB).
    • improvements in Plugin management:
      • bugs fix in Plugin Editor;
      • new ”Plugin” node in the Server Objects List;
      • new submenus in the Server / Plugins menu.
    • improvements in the HoneyMonitor Options.
    • improvements in the View Editor: the SQL Syntax for recreating the view is now formatted in a better way.
    • improvements and bugs fix in the Event Editor:
      • the SQL Syntax for recreating the event is now formatted in a better way;
      • now the user is not required to have privileges on mysql.events.
    • improvements and bugs fix in the UDFs Editor.
    • improvements in the Script Editor: lists in the Tab ”Profiling” now have their popup menu.
    • improvements in the Query Window: the ”Profiling” Tab is now enabled.
    • improvements and bugs fix in the Report Designer (upgrade toFast-ReportTM4.4.60).
  • Bugs Fix:
    • bugs fix in the Federated Server Editor: it failed when setting a port higher than 9999.
    • bugs fix in the View Editor.
    • bugs fix in the Routine Editor (Stored Procedures and Stored Functions).
    • bugs fix in the ”User’s Account Manager”.
    • bugs fix in the Server Properties Window.
    • some memory-related issues have been fixed.
  • Other:
    • an up to date version of MySQLTM Reference Manual is included (it documents MySQLTM through 5.1.24-rc).
    • compatibility tests with MySQLTM ver. 5.1.25-rc, 5.1.23a-maria-alpha, 6.0.5-alpha.

For more information about HoneyMonitor you can visit the product page at http://www.honeysoftware.com/honeymonitor and, for any questions, you can contact me directly.


LogFile Group creation - SQL Errors vs SQL Warnings

July 13, 2008 - 1:00 am - by Santo Leto

On Windows® - but I guess it’s the same on another O.S. that does not support cluster - I noticed the following behavior when trying to execute a CREATE LOGFILE GROUP syntax like this:

CREATE
 LOGFILE GROUP `test`
 ADD UNDOFILE ‘test’
 INITIAL_SIZE = 33M
 UNDO_BUFFER_SIZE = 8M
 ENGINE = NDBCLUSTER;

In v.5.1.25-rc, v.5.1.24-rc and v.5.1.23-rc, only SQL warnings are shown:

mysql> CREATE
    ->  LOGFILE GROUP `test`
    ->  ADD UNDOFILE ‘test’
    ->  INITIAL_SIZE = 33M
    ->  UNDO_BUFFER_SIZE = 8M
    ->  ENGINE = NDBCLUSTER;
Query OK, 0 rows affected, 2 warnings (0.01 sec)

mysql> SHOW WARNINGS;
+———+——+————————————————————————————————+
| Level   | Code | Message
                                  |
+———+——+————————————————————————————————+
| Warning | 1286 | Unknown table engine ‘NDBCLUSTER’
                                  |
| Error   | 1478 | Table storage engine ‘MyISAM’ does not support the create option ‘TABLESPACE or LOGFILE GROUP’ |
+———+——+————————————————————————————————+
2 rows in set (0.00 sec)
 
In v.6.0.5-alpha a SQL error occurs:

mysql> CREATE
    ->  LOGFILE GROUP `test`
    ->  ADD UNDOFILE ‘test’
    ->  INITIAL_SIZE = 33M
    ->  UNDO_BUFFER_SIZE = 8M
    ->  ENGINE = NDBCLUSTER;
ERROR 1478 (HY000): Table storage engine ‘MyISAM’ does not support the create option ‘TABLESPACE or LOGFILE GROUP’

This difference can generate a bug in your applications if you were using code like this:

IF mysql.error = 0 THEN
 ok, post-creation operations
ELSE
 error, do nothing

In fact, the code above is correct if used on v.6.0.5 but it is wrong if used on v.5.1.25 (the application executes the post-creation operations even if the logfile group hasn’t been created).

I don’t remember exactly which version, but an old 5.1.x version had the same behavior of v.6.0.5 - i.e. SQL error - and that was the reason why I coded in that way.

Well.. one more application-bug discovered while testing the version 6.0.5-alpha of the server.

This afternoon I changed the code in this way:

IF (mysql.error = 0 AND mysql.warnings=0) THEN
 ok, post-creation operations
ELSE
 error, do nothing

uhmm, I would like to read such changes (errors -> warnings) in the internal mailing list or in the release notes file of the server (indeed, I’m not sure if it’s included in the chapter “Changes in release 5.1.x”).

Moral:

  • always read the release notes carefully;
  • never eat chocolate biscuits when coding: they could make you lose your concentration!

Discovering FALCON Metadata in MySQL® v. 6.0.5-alpha

July 11, 2008 - 7:21 pm - by Santo Leto

Introduction
MySQL® 6.0.5-alpha, the latest version of the 6.x branch of the Database Server, is available for download from the SUN|MySQL Web Site.

Metadata (data about the data) are very important, especially for software developers. In this article we will see what’s new in FALCON metadata handling doing some comparison with the old 6.0.4-alpha version.

New tables in the `information_schema` database
As you know, the source for metadata is the database `information_schema`. To start, let’s see which tables related with FALCON metadata are included in that database:

mysql> SELECT VERSION();
+—————————+
| VERSION()                             |
+—————————+
| 6.0.5-alpha-community-log |
+—————————+
1 row in set (0.01 sec)

mysql> USE `information_schema`;
Database changed

mysql> SHOW TABLES LIKE ‘FALCON%’;
+—————————————-+
| Tables_in_information_schema (FALCON%) |
+—————————————-+
| FALCON_TABLES                                               |
| FALCON_SERIAL_LOG_INFO                        |
| FALCON_SYSTEM_MEMORY_DETAIL        |
| FALCON_SYSTEM_MEMORY_SUMMARY  |
| FALCON_VERSION                                             |
| FALCON_TRANSACTION_SUMMARY           |
| FALCON_TABLESPACES                                   |
| FALCON_SYNCOBJECTS                                    |
| FALCON_TRANSACTIONS                                |
| FALCON_RECORD_CACHE_DETAIL             |
| FALCON_TABLESPACE_IO                              |
| FALCON_RECORD_CACHE_SUMMARY       |
| FALCON_TABLESPACE_FILES                       |
+—————————————-+
13 rows in set (0.00 sec)

At a glance, we see that we have thirteen tables while in the old 6.0.4-alpha version the tables were only eleven:

mysql> SELECT VERSION();
+—————————+
| VERSION()                             |
+—————————+
| 6.0.4-alpha-community-log |
+—————————+
1 row in set (0.00 sec)

mysql> USE `information_schema`;
Database changed

mysql> SHOW TABLES LIKE ‘FALCON%’;
+—————————————-+
| Tables_in_information_schema (FALCON%)      |
+—————————————-+
| FALCON_TABLES                                                    |
| FALCON_RECORD_CACHE_SUMMARY            |
| FALCON_SYSTEM_MEMORY_DETAIL            |
| FALCON_SERIAL_LOG_INFO                             |
| FALCON_VERSION                                                 |
| FALCON_TRANSACTION_SUMMARY             |
| FALCON_DATABASE_IO                                      |
| FALCON_SYNCOBJECTS                                      |
| FALCON_TRANSACTIONS                                   |
| FALCON_RECORD_CACHE_DETAIL                 |
| FALCON_SYSTEM_MEMORY_SUMMARY      |
+—————————————-+
11 rows in set (0.00 sec)

The new and very useful tables are `FALCON_TABLESPACES` and `FALCON_TABLESPACE_FILES`.

If you played with version 6.0.4-alpha you probably felt the need of similar tables and, if no, you can see why they were important for me looking at bug #37030 .

Also note that the table `FALCON_DATABASE_IO` has been renamed in `FALCON_TABLESPACE_IO` so, for example, the query for calculating the Falcon Cache Hit Ratio by Tablespace becomes:

mysql> SELECT
    ->  `tablespace` AS `Tablespace`,
    ->  100 * 1-(SUM(`physical_reads`) / SUM(IF(`logical_reads` > 1, `logical_reads`,1))) `Cache Hit Ratio`
    -> FROM `information_schema`.`FALCON_TABLESPACE_IO`
    -> GROUP BY `tablespace`;
+——————+—————–+
| Tablespace       | Cache Hit Ratio |
+——————+—————–+
| FALCON_MASTER          |         99.9660 |
| FALCON_TEMPORARY |         99.0000 |
| FALCON_USER                |         99.0000 |
+——————+—————–+
3 rows in set (0.00 sec)

`FALCON_TABLESPACES` and `FALCON_TABLESPACE_FILES` in details
Let’s see the structure of the new tables:

mysql> DESCRIBE `information_schema`.`FALCON_TABLESPACES`;
+—————–+————–+——+—–+———+——-+
| Field           | Type         | Null | Key | Default | Extra |
+—————–+————–+——+—–+———+——-+
| TABLESPACE_NAME | varchar(127) | NO   |     |         |       |
| TYPE            | varchar(127) | NO   |     |         |       |
| COMMENT         | varchar(127) | NO   |     |         |       |
+—————–+————–+——+—–+———+——-+
3 rows in set (0.33 sec)

mysql> DESCRIBE `information_schema`.`FALCON_TABLESPACE_FILES`;
+—————–+————–+——+—–+———+——-+
| Field           | Type         | Null | Key | Default | Extra |
+—————–+————–+——+—–+———+——-+
| TABLESPACE_NAME | varchar(127) | NO   |     |         |       |
| TYPE            | varchar(127) | NO   |     |         |       |
| FILE_ID         | int(127)     | NO   |     | 0       |       |
| FILE_NAME       | varchar(127) | NO   |     |         |       |
+—————–+————–+——+—–+———+——-+
4 rows in set (0.00 sec)

As you can see a column named `COMMENT` is included in `information_schema`.`FALCON_TABLESPACES`, so, unlike version 6.0.4-alpha and previous, in version 6.0.5-alpha you can now specify a comment for your FALCON tablespaces.

Let’s create two FALCON tablespaces, `test1` and `test2`, and see how those two metadata tables are populated:

mysql> CREATE TABLESPACE `test1`
    ->  ADD DATAFILE ‘test1.fts’
    ->  EXTENT_SIZE = 1M
    ->  INITIAL_SIZE = 10M
    ->  COMMENT=’test1-comment’
    ->  ENGINE = FALCON;
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLESPACE `test2`
    ->  ADD DATAFILE ‘test2.fts’
    ->  EXTENT_SIZE = 1M
    ->  INITIAL_SIZE = 10M
    ->  COMMENT=’test2-comment’
    ->  ENGINE = FALCON;
Query OK, 0 rows affected (0.00 sec)

I’d make you aware of the fact that when you create a FALCON tablespace sometimes you can get the following error: “ERROR 1044 (42000): Access denied for user ‘root’@'localhost’ to database ‘information_schema’”. Frankly, at the moment I don’t know why this error occurs. I am trying to create a reproducible bug report. If you experienced that error and you know why it sometimes occurs, please let me know. By the way, if that error will occur you can try closing your client and reopening it. That fix the error for me.

If we select over the table `FALCON_TABLESPACES` we get the following output:

mysql> SELECT * FROM `information_schema`.`FALCON_TABLESPACES`;
+——————+——————+—————+
| TABLESPACE_NAME  | TYPE             | COMMENT       |
+——————+——————+—————+
| FALCON_USER      | FALCON_USER      |               |
| FALCON_TEMPORARY | FALCON_TEMPORARY |               |
| test1            | USER_DEFINED     | test1-comment |
| test2            | USER_DEFINED     | test2-comment |
+——————+——————+—————+
4 rows in set (0.00 sec)

As you can see, there are two rows for what we now call ’system-tablespaces’ - i.e. the tablespaces ‘FALCON_USER’ and ‘FALCON_TEMPORARY’ - and one row for each tablespace created with the CREATE TABLESPACE syntax (in our example ‘test1′ and ‘test2′).

By looking at that table you can also see that there are three types of FALCON tablespaces. One is the type ‘USER_DEFINED’ - that is the type of the tablespaces created by you using the CREATE TABLESPACE syntax - and two are system-related: ‘FALCON_USER’ and ‘FALCON_TEMPORARY’. We will talk about those ’system’ types later.

If we select over the table `FALCON_TABLESPACE_FILES` we get the following output:

mysql> SELECT * FROM `information_schema`.`FALCON_TABLESPACE_FILES`;
+——————+——————+———+———————-+
| TABLESPACE_NAME  | TYPE             | FILE_ID | FILE_NAME            |
+——————+——————+———+———————-+
| FALCON_USER      | FALCON_USER      |       1 | falcon_user.fts      |
| FALCON_TEMPORARY | FALCON_TEMPORARY |       1 | falcon_temporary.fts |
| test1            | USER_DEFINED     |       1 | test1.fts            |
| test2            | USER_DEFINED     |       1 | test2.fts            |
+——————+——————+———+———————-+
4 rows in set (0.02 sec)

As you see, for each FALCON tablespace the name of the file as well as an ID is shown.

`FALCON_TABLES` in details
The table `FALCON_TABLES`, already included in MySQL® 6.0.4-alpha and previous, lists the FALCON tables created on your server:

mysql> DESCRIBE `information_schema`.`FALCON_TABLES`;
+—————+————–+——+—–+———+——-+
| Field         | Type         | Null | Key | Default | Extra |
+—————+————–+——+—–+———+——-+
| SCHEMA_NAME   | varchar(127) | NO   |     |         |       |
| TABLE_NAME    | varchar(127) | NO   |     |         |       |
| PARTITION     | varchar(127) | NO   |     |         |       |
| TABLESPACE    | varchar(127) | NO   |     |         |       |
| INTERNAL_NAME | varchar(127) | NO   |     |         |       |
+—————+————–+——+—–+———+——-+
5 rows in set (0.00 sec)

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`;
Empty set (0.00 sec)

In my system I get an empty set because there are no FALCON tables at the moment.

Let’s now try answering to the following question: “why do we have two system-related FALCON tablespaces (’FALCON_USER’ and ‘FALCON_TEMPORARY’)?”

The answer is quite simply. When you create a FALCON table you can specify a FALCON tablespace as a table option (CREATE TABLE … TABLESPACE) but if you don’t set a tablespace the FALCON table being created will use the default system tablespaces.

Let’s see this in action.

mysql> CREATE DATABASE `fdatabase`;
Query OK, 1 row affected (0.05 sec)

mysql> USE `fdatabase`;
Database changed

mysql> CREATE TABLE `fdatabase`.`ftable_generic`
    ->  ENGINE = FALCON
    ->  IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 3 rows affected (0.64 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`;
+————-+—————-+———–+————-+—————-+
| SCHEMA_NAME | TABLE_NAME     | PARTITION | TABLESPACE  | INTERNAL_NAME  |
+————-+—————-+———–+————-+—————-+
| FDATABASE   | FTABLE_GENERIC |           | FALCON_USER | FTABLE_GENERIC |
+————-+—————-+———–+————-+—————-+
1 row in set (0.00 sec)

As you can see, we now have our FALCON table listed in `information_schema`.`FALCON_TABLES` and we can see that the tablespace used by the table just created is the system-related tablespace ‘FALCON_USER’.

Let’s create a temporary FALCON table (as before, without setting a tablespace) and see that the ‘FALCON_TEMPORARY’ tablespace is used:

mysql> CREATE TEMPORARY TABLE `fdatabase`.`ftable_generic_temporary`
    ->  ENGINE = FALCON
    ->  IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 3 rows affected (0.19 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`;
+————-+—————-+———–+——————+—————-+

| SCHEMA_NAME | TABLE_NAME     | PARTITION | TABLESPACE       | INTERNAL_NAME  |

+————-+—————-+———–+——————+—————-+

| FDATABASE   | FTABLE_GENERIC |           | FALCON_USER      | FTABLE_GENERIC |

| TEMP        |                |           | FALCON_TEMPORARY | #SQL1FF4_13_0  |

+————-+—————-+———–+——————+—————-+

2 rows in set (0.00 sec)

If we drop the temporary table:

mysql> DROP TABLE `fdatabase`.`ftable_generic_temporary`;
Query OK, 0 rows affected (0.13 sec)

we have:

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`;
+————-+—————-+———–+————-+—————-+
| SCHEMA_NAME | TABLE_NAME     | PARTITION | TABLESPACE  | INTERNAL_NAME  |
+————-+—————-+———–+————-+—————-+
| FDATABASE   | FTABLE_GENERIC |           | FALCON_USER | FTABLE_GENERIC |
+————-+—————-+———–+————-+—————-+
1 row in set (0.00 sec)

You can now guess what’s happen if you specify a FALCON tablespace in the CREATE TABLE syntax:

mysql> CREATE TABLE `fdatabase`.`ftable1_test1`
    ->  TABLESPACE `test1`
    ->  ENGINE = FALCON
    ->  IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 3 rows affected (0.16 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`;
+————-+—————-+———–+————-+—————-+
| SCHEMA_NAME | TABLE_NAME     | PARTITION | TABLESPACE  | INTERNAL_NAME  |
+————-+—————-+———–+————-+—————-+
| FDATABASE   | FTABLE_GENERIC |           | FALCON_USER | FTABLE_GENERIC |
| FDATABASE   | FTABLE1_TEST1  |           | test1       | FTABLE1_TEST1  |
+————-+—————-+———–+————-+—————-+
2 rows in set (0.00 sec)

We can see above that the FALCON table `ftable1_test1` uses the tablespace ‘test1′.

Let’s create a second table using the tablespace ‘test1′:

mysql> CREATE TABLE `fdatabase`.`ftable2_test1`
    ->  TABLESPACE `test1`
    ->  ENGINE = FALCON
    ->  IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 3 rows affected (0.19 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`;
+————-+—————-+———–+————-+—————-+
| SCHEMA_NAME | TABLE_NAME     | PARTITION | TABLESPACE  | INTERNAL_NAME  |
+————-+—————-+———–+————-+—————-+
| FDATABASE   | FTABLE_GENERIC |           | FALCON_USER | FTABLE_GENERIC |
| FDATABASE   | FTABLE1_TEST1  |           | test1       | FTABLE1_TEST1  |
| FDATABASE   | FTABLE2_TEST1  |           | test1       | FTABLE2_TEST1  |
+————-+—————-+———–+————-+—————-+

Filtering FALCON Tables by TableSpaces
Now a common question is: “Which are the FALCON tables that are using a particular tablespace?”. Here’s the possible answer:

mysql> SELECT CONCAT(’`', `SCHEMA_NAME`, ‘`.`’, `TABLE_NAME`, ‘`’) FROM `information_schema`.`FALCON_TABLES` WHERE `TABLESPACE` = ‘test1′;
+——————————————————+
| CONCAT(’`', `SCHEMA_NAME`, ‘`.`’, `TABLE_NAME`, ‘`’) |
+——————————————————+
| `FDATABASE`.`FTABLE1_TEST1`                          |
| `FDATABASE`.`FTABLE2_TEST1`                          |
+——————————————————+
2 rows in set (0.00 sec)

Unfortunately, you should note that this method fails due to bug #35210.
In fact, let’s create a FALCON table with a strange name and see what happen:

mysql> CREATE TABLE `fdatabase`.`ftable_strange_name_#_!_test1`
    ->  TABLESPACE `test1`
    ->  ENGINE = FALCON
    ->  IGNORE AS SELECT * FROM `mysql`.`user`;
Query OK, 3 rows affected (0.23 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM `information_schema`.`FALCON_TABLES`\G
*************************** 1. row ***************************
  SCHEMA_NAME: FDATABASE
   TABLE_NAME: FTABLE_GENERIC
    PARTITION:
   TABLESPACE: FALCON_USER
INTERNAL_NAME: FTABLE_GENERIC
*************************** 2. row ***************************
  SCHEMA_NAME: FDATABASE
   TABLE_NAME: FTABLE1_TEST1
    PARTITION:
   TABLESPACE: test1
INTERNAL_NAME: FTABLE1_TEST1
*************************** 3. row ***************************
  SCHEMA_NAME: FDATABASE
   TABLE_NAME: FTABLE2_TEST1
    PARTITION:
   TABLESPACE: test1
INTERNAL_NAME: FTABLE2_TEST1
*************************** 4. row ***************************
  SCHEMA_NAME: FDATABASE
   TABLE_NAME: FTABLE_STRANGE_NAME_@0023_@0021_TEST1
    PARTITION:
   TABLESPACE: test1
INTERNAL_NAME: FTABLE_STRANGE_NAME_@0023_@0021_TEST1
4 rows in set (0.00 sec)

The table `ftable_strange_name_#_!_test1` is stored in the FALCON metadata catalog with the name `FTABLE_STRANGE_NAME_@0023_@0021_TEST1` so the method above fails:

mysql> SELECT CONCAT(’`', `SCHEMA_NAME`, ‘`.`’, `TABLE_NAME`, ‘`’) FROM `information_schema`.`FALCON_TABLES` WHERE `TABLESPACE` = ‘test1′;
+——————————————————+
| CONCAT(’`', `SCHEMA_NAME`, ‘`.`’, `TABLE_NAME`, ‘`’) |
+——————————————————+
| `FDATABASE`.`FTABLE1_TEST1`                          |
| `FDATABASE`.`FTABLE2_TEST1`                          |
| `FDATABASE`.`FTABLE_STRANGE_NAME_@0023_@0021_TEST1`  |
+——————————————————+
3 rows in set (0.00 sec)

We do not get the correct list of FALCON tables: the table `FDATABASE`.`FTABLE_STRANGE_NAME_@0023_@0021_TEST1` does not exist:

mysql> DESCRIBE `FDATABASE`.`FTABLE_STRANGE_NAME_@0023_@0021_TEST1`;
ERROR 1146 (42S02): Table ‘fdatabase.ftable_strange_name_@0023_@0021_test1′ does n’t exist

Indeed, you should note that it is not difficult to avoid such a problem at software-level. For example you can create a function to parse, using defined rules, the name `FTABLE_STRANGE_NAME_@0023_@0021_TEST1`. With this approach you have a function that returns the real name `ftable_strange_name_#_!_test1`.

Conclusion
It’s now time to close this article. New features of the FALCON metadata catalog have been (in part) explained.

For other interesting stuff, you can refer to the articles by Robin Schumacher available on the SUN|MySQL Web Site at dev.mysql.com.