The following describes how to query and count the sum of a field in MYSQL:
SELECT sum ('field of value') FROM 'table name'Articles you may be interested in
How to sort the database query results in the alphabetic order of the first Chinese
In mysql, rand () can be used for random search.
Example [Query 10 data records randomly in the tt_dvjobs table]
Select * from 'tt _ dvjobs' order by rand () LIMIT 0, 10;
Practice has proved that modifying the function will cause very low query
[Oracle11g, 19] index managementI. Index classification: 1. logically divided into: Single Column index and compound index unique index and non-unique index function index domain index 2. Physical score: partition index and non-partition index
Query index page fragments: show table status like 'table name'; // when the value of the Data_free column is greater than 0, fragments are generated (as long as data is deleted, the premise is to create an index) OPTIMIZE the TABLE: optimize table
The previous article briefly introduced the usage of the EXPLAIN statement. Today we will introduce the following:
Slow query log
Enable slow query log
Save slow query logs to the table
Slow query log analysis
Percona Toolkit
Install
After a low-efficiency SQL statement is queried, you can use the EXPLAIN or DESC command to obtain information about how MySQL executes the SELECT statement, including how the table connects to and connects to the table during the execution of the
As a little programmer, it is inevitable to deal with where in and like in daily development, in most cases, the parameters we pass are not much simple, single quotation marks, sensitive characters escape, and then directly spelled into the SQL,
In the process of web development with a large amount of data, you must carefully think about whether there is a better way to improve the efficiency of program execution. Next we will share a method that is frequently used but easily overlooked in
This article analyzes the problem of slow query on the MySQL database server and puts forward the corresponding solutions. The specific solutions are as follows:
Developers often find that they do not use indexed or limit n statements, which will
Official documents docs.oracle.comcdb19306_01server.102b14220schema.htm # The data Insertion Location of the CNCPT911 heaptable table is random, mainly determined by the idle data blocks in the database. The retrieved data is calculated based on the
The following describes the concepts and operations of partition tables in oracle table partitions: concept of table partitions in Table spaces and partition tables specific roles of table partitions Advantages and Disadvantages of table partitions
1. A question describes how an SQL statement is executed in a database? I believe many people will be interested in this issue. Of course, it is a huge problem to fully describe the lifecycle of an SQL statement in the database, it covers a series
Correct use of MySQL index Query
Index is the most important tool for improving the query speed. Of course there are other technologies available for use, but in general, the biggest performance difference is the correct use of indexes. In the MySQL
Before giving you a detailed introduction to Oracle B-tree indexes, let's first take a look at non-unique indexes and then give a full introduction to Oracle B-tree indexes. The Oracle B-tree index does not have a unique entry.
In a non-unique index,
1. char and varcharchar: Fixed Length, suitable for storing very short (such as house number 101,201), fixed length (such as using uuid as the primary key), column fields with very frequent changes; char (M) each of the Data columns occupies M bytes.
As a small programmer, it is inevitable to deal with where in and like in daily development, in most cases, the parameters we pass are not much simple, single quotation marks, sensitive characters escape, and then directly spelled into the SQL,
SpellCheck is a new version of Lucene functionality, before introducing spellcheck, we need to figure out spellcheck support several data sources. The SpellCheck constructor requires an incoming dictionary interface: Package
Explain how to use and use table partitions in oracle table shards.
This article describes the concepts and operations of Partitioned Tables from the following aspects:
1. Concepts of tablespaces and partition tables
2. Specific functions of table
MySql optimization steps (recommended), mysql optimization steps recommended
General steps for MySql optimization:
1. Run the show status command to check the execution efficiency of various SQL statements.
Show status provides the STATUS
MySQL execution Status Analysis
When you feel that mysql performance is faulty, you will usually first check the current mysql execution status and use show processlist to view it. For example:
The state column information is very important. First,
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.