MySQL (1)

Source: Internet
Author: User

MySQL (default data table Myisam&inonodb)

Can be set in MySQL config file My.ini, the book is written in Default-table-type. But not found in the My.ini, but

# The default storage engine that would be used when create new tables when
Default-storage-engine=innodb

MyISAM, mature, stable, easy to manage. Divided into three kinds of MyISAM static, MyISAM dynamic and MyISAM compressed

    1. MyISAM Static: Data columns each have a defined "fixed length", High data access efficiency (on the basis of frequent changes)
    2. MyISAM Dynamic: Data column has no fixed length, storage efficiency is high; disadvantage: a large amount of data fragmentation is generated when deleting
    3. MyISAM compressed: Compress the MyISAM, take up less space; disadvantage: Data small becomes read-only data table, cannot modify

The evolution version of Innodb,myisam adds the functions of transaction, FOREIGN KEY constraint and so on. Disadvantage: I don't know if there are any more, after all, the times are developing

Summary: If the space and time requirements are high, the use of MyISAM, if you need transactions, foreign keys, data row-level locking mechanism, the use of InnoDB

HEAP (Temporary data table) {Hash index hash indexes, advantages: fast Access}

Heap restriction: Cannot use---TEXT 、---bolb, <, >, <=, >=, auto_increment; index NOT NULL only

The length of the HEAP data sheet in the book was not found in the config file, config_max_heap_table_size

The data column width (INT (4)) acts like the conversion specifier%4d in the C language, and Warning (can cause truncation of data when performing complex queries that need to be completed with the help of a temporary data table)

Auto_increment

    1. Only one a_t data column per table
    2. Select LAST_INSERT_ID ()
    3. If it grows to the maximum value, it will not continue to increment, and no more data will be inserted
    4. If you have a_t, you must have primary key

Bit&bool (binary)

Float&doule (REAL) floating point number

(m,d) m specifies the number of decimal digits, but only the display effect; d specifies the number of digits after the decimal point (which is rounded)

The inserted data will be rounded as necessary

Decimal (fixed number)

Use decimal If rounding will produce errors. Decimal is used to save data in the form of a string

DATE, Time, Datatime, year, Timetamp

Data type that represents a date

Timetamp, the time of the last modification is recorded when the data is modified

If you do not want to save the recording time for this modification, update tablename SET col=new value,ts=ts;

If you want to make a date layout, use Data_format ()

MySQL (1)

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.