DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info.gz) FEDERATED description

Info Catalog (mysql.info.gz) FEDERATED install (mysql.info.gz) FEDERATED storage engine (mysql.info.gz) FEDERATED use
 
 14.6.2 Description of the `FEDERATED' Storage Engine
 ----------------------------------------------------
 
 When you create a `FEDERATED' table, the server creates a table
 definition file in the database directory. The file begins with the
 table name and has an `.frm' extension.  No other files are created,
 because the actual data is in a remote database. This differs from the
 way that storage engines for local tables work.
 
 For local database tables, data files are local. For example, if you
 create a `MyISAM' table named `users', the `MyISAM' handler creates a
 data file named `users.MYD'.  A handler for local tables reads, inserts,
 deletes, and updates data in local data files, and records are stored
 in a format particular to the handler. To read records, the handler
 must parse data into columns.  To write records, column values must be
 converted to the row format used by the handler and written to the
 local data file.
 
 With the MySQL `FEDERATED' storage engine, there are no local data
 files for a table (for example, there is no `.MYD' file). Instead, a
 remote database stores the data that normally would be in the table.
 This necessitates the use of the MySQL client API to read, delete,
 update, and insert data. Data retrieval is initiated via a `SELECT *
 FROM TBL_NAME' SQL statement.  To read the result, rows are fetched one
 at a time by using the `mysql_fetch_row()' C API function, and then
 converted from the columns in the `SELECT' result set to the format
 that the `FEDERATED' handler expects.
 
 The basic flow is as follows:
 
   1. SQL calls issues locally
 
   2. MySQL handler API (data in handler format)
 
   3. MySQL client API (data converted to SQL calls)
 
   4. Remote database -> MySQL client API
 
   5. Convert result sets (if any) to handler format
 
   6. Handler API -> Result rows or rows-affected count to local
 
 
Info Catalog (mysql.info.gz) FEDERATED install (mysql.info.gz) FEDERATED storage engine (mysql.info.gz) FEDERATED use
automatically generated byinfo2html