To create the Mysql_order_by_test datasheet by following the table structure below, let's use the example 1.1 to tell you the MySQL order by usage.
ORDER BY UID ASC
Query the data according to the UID positive order, that is, by the UID from small
Although an order by is not exactly the same as an index, an index can be used, as long as the unused index portion and all the extra orders by fields are included in the WHERE clause.
Use the indexed MySQL order bySeveral of the following queries
The index field length is too long,
1. Modify the length of the field
2. Modify the MySQL default storage engine
Join Default-storage-engine=innodb under [mysqld] of/ETC/MYSQL/MY.CNF
But it's clear in the building that you need to use the InnoDB
1. The premise is that MyEclipse has been able to properly develop Java engineering
2. Install MySQL
The individual is using the version is Mysql-5.0.22-win32.zip
URL: http://www.mysql.com/downloads/mysql/#downloads
3. Download JDBC Driver
The
About MySQL efficiency optimization typically uses the following two ways to locate execution-less efficient SQL statements.
With slow query logs locating those SQL statements that perform less efficiently, when started with
TIMESTAMP setting defaults is default Current_timestamp
TIMESTAMP settings update automatically with table changes is on update current_timestamp
But because
There can be at most one field set in a table Current_timestamp
It is not possible to set
Monitoring SQL statement execution efficiency based on MySQL slow log
Enable MySQL log-slow-queries (slow query record).
In the Linux environment to find the My.cnf file (generally in/etc/mysql/), and then you may find that the file can not be
Perror 28
Error Code 28:no space left on device
SQL statement execution error: SELECT title,gid from Blog_blog WHERE Date Error writing file ' C:\WINDOWS\TEMP\MY9B6F.tmp ' (errcode:28)
Workaround:
1. Free C:\WINDOWS\TEMP\ Space
2. Because
The examples in this article describe how MySQL views, creates, and deletes indexes. Share to everyone for your reference. Specifically as follows:
1. Indexing effect
On the index column, in addition to the ordered lookup mentioned above, the
--Data for the row with the largest (small) value grouped by a field
Copy Code code as follows:
/*
The data are as follows:
Name Val Memo
A 2 A2 (the second value of a)
The first value of a 1 a1--a
The third value of a 3 a3:
MyISAM and memory using table-level locks (table-level locking)
BdB with page locks (page-leve locking) or table-level locks, default to page locks
InnoDB supports row-level locks (row-level locking) and table-level locks, which default to
In MySQL, a table with the InnoDB engine type supports foreign key constraints.Use conditions for foreign keys:1. Two tables must be INNODB tables, MyISAM table temporarily does not support foreign keys (it is said that future versions may be
Here are 19 main points of MySQL performance optimization to share with you, learn together.
1, for the query to optimize your queryMost MySQL servers have query caching turned on. This is one of the most effective ways to improve sex, and it is
Startup failedRestart the server after--> restart the application service (confluence)--> error, database connection failed (MySQL set up from boot)--> view MySQL database status:
[Root@fisheye ~]# Ps-ef | grep MySQL
root 25555 21974 0 11:2
1. Multi-table connection type 1. Cartesian product (cross connection) in MySQL can be cross join or omit cross that join, or use ', ' such as:
SELECT * FROM table1 CROSS join table2
SELECT * to table1 join table2
SELECT * from
MySQL log mainly includes: error log, query log, slow query log, transaction log, binary log;
Log is an important part of MySQL database. The log file records the changes that occurred during the MySQL database operation, that is, the client
Have been heard MySQL5.5 performance is very NB, so the recent plan to test, convenient time to upgrade the bbs.kaoyan.com to this version of the database. Today I just saw a summary of MY.CNF optimization, although it has not been my own practice
View MySQL database tablesEnter the MySQL Command line clientTo view the database currently in use:
Mysql>select database ();
mysql>status;
Mysql>show tables;
Mysql>show databases;//can see which databases are available, return the database
Fedora under the MySQL command first to repeat a few words, I was just beginning to learn MySQL, if there is a wrong place, please correct me, hope that their little experience, can help everyone. Let's start by introducing my installation:
1. My
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