MySQL Study notes Day Fourth

Source: Internet
Author: User

MySQL Engine:
Archive (archives) [data insertion cannot be modified after, read-only]
blackhole[This write operation is to delete the data, the read operation is to return a blank record]
Csv[a comma as a delimiter between data items when storing data]
example[example (stub) storage engine]
falcon[the type of storage used to process transactions]
Federated[the storage engine used to access remote data tables]
innodb[transaction engine with foreign key support]
memory[in-memory data sheet]
Merge[A collection of data tables that are used to manage multiple MyISAM data tables (MERG-MYISAM)]
MyISAM Default Storage type
Ndb[mysql Clustor Special Engine]

Part II:
No_engine_substitution settings do not use the default engine (not successful when creating a data table type)
Use Default-storage-engine to start the server with a default storage engine
Show CREATE TABLE Table_name=select condition from information_schema.tables[view default engine]
Using the min-rows=n to optimize the memory engine
eg
CREATE TABLE table_name{...} Engine=memory min-rows=100;
Control the size of the MyISAM using Max-rows and Avg-row-length
Changing the data table engine: ALTER TABLE table_name TYPE[ENGINE]=TYPE_NAME
Use if not exist to create a table to check for the same table, but at a certain risk, use the drop table if exist to execute the CREATE table

Temp table:
Creating a temporary table: Create temporary table table_name (also supports a variety of engines), the life cycle of a temporary table is typically the server stops staging table type
You can have the same name as a permanent table, but a permanent table is temporarily invalidated until the temporary table loses its effect.

use like and select to create new data tables from other data tables
CREATE TABLE table_name as _table_name so that new data tables are created with the same type, index, order ,
INSERT INTO table_name SELECT ... [Insert table data or other data after select], you can use this method to create a
temporary copy: Temporary
inserts additional table data into the copy eg:insert into new_table_name select * from Ta Ble_name[where ...]; The
uses the CREATE TABLE table_name Select to one step the above two types, but the data in this case may be indexed or may lose data properties

provides a clear definition in the CREATE TABLE section, and then the Select section uses those definitions to retrieve:

select I as I,cast (Curtime () as time) as T,-----------------(this passage does not read the meaning = =.) )
ps:select Sentence Select fill in data requirements.

Merge data sheet:
The merge handles MyISAM as a connection unit, and each member of a merge data table has the same order, data type, index, etc.
eg
CREATE TABLE Log_ccyy
(dt datetime NOT NULL,
Info varchar (+) NOT NULL,
Index (DT)
);
Ccyy is the meaning of the year, assuming the creation of the log_2010,log_2011, after creating a merge type:
CREATE TABLE Log_merge
(DT datetime Notnull,
Info varchar (+) NOT NULL
Index (DT)

) Engine=merge union= (log_2010,log_2011)
    [Insert_method=[no\first\last]];
When creating a new merge unit (MyISAM table type), the inserted position first or last or no does not allow inserting a new data table
Log_merge Add data Table log_2012:
ALTER TABLE log_merge= (LOG_2010,LOG_2011,LOG_2012)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.