To optimize the query, try to avoid full table scanning. First, create an index on the columns involved in where and order.
2. Try to avoid null value determination on the field in the where clause. Otherwise, the engine will discard the index and
MySQL Data Types and query efficiency
Do not use a long value when using short data columns. If you have a CHAR data column with a fixed length, do not let it exceed the actual length. If the maximum value stored in the data column is 40 characters,
MySQL Stored Procedure examples, including transactions, parameters, nested calls, cursors, loops, etc.
MySQL Stored Procedure examples, including transactions, parameters, nested calls, cursors, loops, etc.
Drop procedure if exists
Mysql Optimization Configuration
Tmp_table_size: 500 mb
Key_buffer_size = 384 m // key_buffer_size specifies the buffer size used for the index. increase it to get more
Good Index processing performance. This parameter can be set to 384 M or M for
DELETE statementThe DELETE statement is used to DELETE rows in a table.
SyntaxDelete from table name WHERE column name = value Person:LastName FirstName Address CityGates Bill Xuanwumen 10 BeijingWilson Fred Zhongshan 23 NanjingDelete a row"Fred
1. Use the api function library provided by mysql.Many well-known mysql client tools are implemented in this way, as is the well-known winmysql tool. This can be implemented in most development tools. For example, vc, bcb, delphi, and vb can be
The group by clause allows an additional row to be added to the simple output end WITH the ROLLUP modifier. These rows represent high-level (or high aggregation) simple operations. ROLLUP allows you to answer questions from the perspective of
CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result...] [ELSE result] end case when [condition] THEN result [WHEN [condition] THEN result...] [ELSE result] In the return result of the first scheme, value = compare-value.
Mysql database program optimization method1. select the most suitable field attribute
MySQL can support access to large data volumes, but generally, the smaller the table in the database, the faster the query will be executed on it. Therefore, when
The SQL NOW () function obtains the data of the current day.
In the NOW () functionReturn the current system date and time in the NOW () function.Current SQL () syntax
SELECT NOW() FROM table_name
Prod_Id
ProductName
Unit
MySQL connection before you can do anything with MySQL PHP, you must first establish a MySQL database connected to your web host. This is the connection function with MySQL.
MySQL connectionBefore you can do anything with MySQL PHP, you must first
SQL JOIN keyword usage
The JOIN keyword is used to query data from two or more tables. Some relations are listed in these tables.Database JOINKeyword connection uses SQL statements to query data from two or more tables, and some relationships are
SQL LEFT JOIN keyword tutorial
The left join keyword returns all rows from the LEFT table (table_name1), even if there is no right table for the competition (table_name2 ).SQL syntax added on the left
SELECT column_name(s)FROM table_name1LEFT JOIN
If you want to directly store binary data, such as image files and HTML files, in your MySQL database, this article is for you! I will show you how to store these files through HTML forms and how to access and use these files.Overview:Create a new
Use the command line mode!Log on to the databaseMysql-h host name-u user name-p PasswordAfter that, do you know the encoding of the exported file? If it is GBKMysql> set names gbk;UTF8Mysql> set names utf8;If you do not know, try and the encoding is
Changing the password in mysql generally refers to modifying the root password. If it is another user's password, we can modify it directly using phpmyadmin, next, I will introduce how to change the password and set user permissions.
Use phpmyadmin
If you need to perform mysql table sharding, we will prove that your database is relatively large, that is, to divide a table into N multiple small tables. After Table sharding, The concurrency of a single table is improved, disk I/O performance is
In mysql, both FOUND_ROWS () and COUNT (*) can collect statistical records. If both are the same, why are there two such functions? Next I will introduce SELECT FOUND_ROWS () and COUNT (*) usage differences
In SELECT statements, LIMIT is often used
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.