When the database query rate is slow, the corresponding table can be added to the corresponding index, which can effectively improve the query efficiency, the MySQL database added indexed SQL into the following:ALTER TABLE ' table_name ' ADD INDEX
the principle of MySQL master (Master) copy from (slave) :1. Master records data changes to binary logs (binary log ) , which is the configuration file log-bin Specified files ( These are called binary log events, binary logs event)2. Slave
Immediately following the previous chapter, because the project is now based on spring as the main container management framework, write how spring integrates multiple data sources.1.backgroundwe generally apply to the database is "read more write
Determine two servers MySQL version consistent 1. Modify master server Master configuration # Edit Profile vi/etc/my.cnf [mysqld] Log-bin=mysql-bin//[must] enable binary log, add log directory Server-id=7// [must] from the server unique ID, the
The modified users are listed as root.first, the root of the original myql password;Method One:Outside the MySQL system, use the Mysqladmin#mysqladmin-u root-p Password "test123"Enter Password: "Enter the original password"Method Two:By logging into
Implement a simple move table, using a cursor loopThe first line DELIMITER//and the last line//must, or encounter a semicolon to errorDelimiter //create procedure movedata () begin declare Done int default 0; declare v_id varchar (+)
Design Optimization – scenarios where the index cannot be used? the number of records scanned by the index exceeds 30% and becomes a full table scan? in a federated index, the first index column uses a range query--only partial indexes are used? in
1. Create Group Byselect ven_id,count (*) as Num_prods from the products group by VEN_ID; Note: Group by can contain any number of columns each column listed by the group must be retrieved A column or a valid expression (but not a clustered function)
How to use exists and in:SELECT * from a where exists (select * from B where a.id=b.id), select * from a where a.id in (select ID from B);1, exists is to do Loop loop, each loop loop and then query the internal table (sub-query), then is the index
Operations on Table RecordsHttp://www.cnblogs.com/linhaifeng/articles/7267587.htmlAdd: Insert1. Insert full data (sequential insertion)Syntax One:INSERT into table name (Field 1, Field 2, Field 3 ...) field N) VALUES (value 1, value 2, value 3 ...)
1, download MySQLOpen MySQL's official website www.mysql.com, found a downloadsClick on it, go to the MySQL download page, there is a MySQL Community Edition at the bottom of the page, and there is a blue link belowClick on this blue link to go to
First, the data type
See: http://www.runoob.com/mysql/mysql-data-types.html
Ii. Types of choice
Plastic >date,time>enum,char>varchar>blob,text
For data types of the same level, it is preferable to select a data type that occupies
One, MySQL server logical architecture diagram each dashed box is a layer: the first layer: the topmost server is not unique to MySQL, most network-based client/server tools or services have similar systems. such as link processing,
SQL Server and MySQL have some differences in the concurrent processing of "yes, update, no ., Sqlmysql
"Update if yes, insert logic if no exist" concurrent processing
In sqlserver:
In sqlserver, you can lock a range by serializing the isolation
Mysql -- view,1. view features
When a view comes from multiple basic tables, data cannot be added or deleted.2. Create a view
Although a view can be viewed as a virtual table, it does not physically exist, that is, the database management system
MySQL-basic concepts,
I. Mysql logic architecture
Reference from high performance Mysql
Ii. Concurrency Control
Read/write locks: Read locks are shared and exclusive, blocking other write and read locks.
Lock granularity: Table lock and
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