size-1)" with a digital number.
MYSQLSELECT * from tt limit 1, 20SELECT * from tt limit 21,30/*If you have tens of thousands of data, you can directly use the limit Function of mysql. If it is more than 1 million of data, you may have to explain the method, next we will create a paging query statement for millions of data records.Mysql> select * from news where
finds that a value has a high percentage in the table's data rows, it generally ignores the index, scan the entire table. The usual percentage line is "30% ". Now the query optimizer is more complex and other factors are taken into account. Therefore, this percentage is not the only factor for MySQL to choose whether to use scan or index.The value with a short index. Use smaller data types as much as possi
A basic tutorial on querying logs and slow query logs in MySQL,
I. query logs
Query all the queries in MySQL by using "-- log [= file_name. Because all the queries, including all the select statements, are recorded, and the size i
Redis for beginners (3) -- using Redis as the cache of Mysql database, redismysql
After the Mysql result set is cached in the Redis string or hash structure, we are faced with a new problem, such as what these strings or hash names are, that is, how to determine their keys. Because the rows corresponding to these data structures belong to a result set, if you can
"]=>
string(10)"1253626081"
}
[1]=>
array(7){
["article_id"]=>
string(2)"31"
["article_title"]=>
string(5)"22222"
["article_count"]=>
string(1)"0"
["article_type"]=>
string(1)"8"
["article_tag"]=>
string(14)"22222222222222"
["article_content"]=>
string(27)"222222222222222222222222222"
["article_time"]=>
string(10)"1253626095"
}
}
MySQL Date and Time Functions
Transformed from the
MySQL query optimization and MySQL Optimization1. Introduction
A good web application has excellent access performance. MySQL database is an integral part of web applications and an important part that determines their performance. Therefore, it is vital to improve MySQL per
Cacti queries the disk size occupied by the mysql database and returns php modifications. However, with the template configured in cacti, you can create tables in the device and generate data source entries, but there is no returned data and I don't know what the problem is. There is no solution for the moment.I tried to use the script query and script_server met
between the caching mechanism of the INNODB storage engine and the MyISAM is that InnoDB not only caches the index, but also caches the actual data. So, the exact same database, using the InnoDB storage engine, can use more memory to cache database-related information, assuming there is enough physical memory. This is certainly an attractive feature in an era of declining memory prices.
The innodb_buffer_pool_size parameter is used to set the InnoDB
of MySQL
Basis for query execution
Customer first sends a query to the server
The server checks the cache first, and if the cache is hit, returns the results stored in the cache immediat
temporary table increases created_tmp_tables, and the disk-based table increases created_tmp_disk_tables. There are no strict rules for this ratio, because it depends on the query involved. Long observation Created_tmp_disk_tables Displays the ratio of disk tables created, and you can determine the efficiency of the settings. Both Tmp_table_size and max_heap_table_size can control the maximum size of a tem
Label:Reprinted from the script house http://www.jb51.net/article/51831.htm busy squirrel For large sites such as Facebook,ebay and other sites, if there is no memcache as the intermediate cache layer, data access is not possible feel all, for the general site, as long as there is a separate server, can be configured through Memcache to improve site access speed and reduce database pressure, This paper mainly discusses the process relationship between
This article mainly introduces how to optimize the query statements in the MySQL database, for more information, see the system performance bottleneck of websites established based on php + MySQL. The most commonly used statements in MySQL are query statements, optimization
MySQL 20W data 1G size with like odd slow, seek solution.
$sql =select * ' from ' the text ' where ' title ' Like '%bbd% ' limit 0,10
$sql =mysql_query ($sql); In less than 1 seconds.
But to ask like to get the total number is very slow 10 seconds + ... To find a solution.
$SQLL =select ' id ' from ' title ' where ' title ' Like '%bbd% '
$SQLL =mysql_query ($sql);
$num = mysql_num_rows ($SQLL); It's in th
to consider the EXPLAIN keyword. The EXPLAIN keyword is generally placed before the SELECT query statement to describe how MySQL performs the query operation, and the number of rows to be executed in the result set returned by MySQL.
3. adjust internal variables
MySQL is s
records. Because there are enough cache headers, and for that reason, the table does not come and is used for database/table sharding.
The problem is that when the data magnitude is less than 0.1 billion, the mysql optimizer chooses to use the index. When the data magnitude exceeds 0.1 billion, the mysql query optimi
1, look at the machine configuration, refers to three piece: CPU, memory, hard disk
2, look at the MySQL configuration parameters
3, check the MySQL line state, you can use the Mysqlreport tool to view
4, view the MySQL slow query
After solving the above problem in sequence, we can find the problem of the program.
To know the size of each database, follow these steps: 1. Enter the information_schema database (which stores information about other databases) useinformation_schema; 2. query the size of all data: selectconcat (round (sum (data_length10241024), 2), MB) asdatafromtables; 3. view the specified
To know the size of each
.
Verify:
The authentication method is very simple, run cat 3 >/proc/sys/vm/drop_caches under the shell with root privileges to empty the OS file cache and run SQL to see if it is the same speed as the first run.
Results:
Well, afterEcho 3/proc/sys/vm/drop_caches , it's slow again, and it looks like you're talking about a problem.
Extended:
Once you know the MyISAM feature, you can use the file pre-re
This article mainly introduces Mysql Query statement optimization techniques. For more information, see index optimization, query optimization, query cache, server setting optimization, operating system and hardware optimization, application-level optimization (web server,
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.