Mysql study Note 3 (INDEX), mysql study note IndexIndex
Database Object Index: A combination of data. By indexing objects, you can quickly query specific records in the database object table. It is the most common way to improve performance.
An
If you do not want repeated records in the data table, you can add a unique index for the table.
For example, the user table has two fields: user_id and user_name. If you do not want two identical user_id and user_name, you can add the Union unique
Previously, I did not pay much attention to my blog. I felt distressed when I lost my blog. Now I am paying attention to it and decided to regularly back up SQL statements. Write a script as follows:
Copy codeThe Code is as follows :#! /Usr/bin/perl
How does PHP automatically back up database tables? This article and everyone to share the use of PHP automatic Backup database table implementation method, to make a reference to everyone, hope to help everyone.
1. Preface
There are many ways to
Using the Mapper interface, without writing the interface implementation class, directly complete the database operation, simple and convenient. In order to help everyone to better learn Mapper interface, small series summed up some knowledge about
How to use indexes in MySQL for detailed analysis and examples can greatly improve the query speed by using indexes in database tables. Suppose we have created a testIndex table:
Create table testIndex (I _testID INT NOT NULL, vc_Name VARCHAR (16)
How to optimize the MYSQL database and optimize the mysql database
1. select the most suitable field attribute
Minimize the length of the defined field and set the field not null, for example, 'province, gender'. It is best to set it to ENUM.
2. Use
How to Use php to automatically back up database tables and use php to back up database tables
1. Preface
There are many backup methods for mysql databases;
For example:
1. Use the mysqldump Function
Mysqldump-u username-p dbname table1 table2...>
1. Try the thrift Python/java as well as the HBase client API, with the following conclusions:the installation and release of 1.1 thrift may encounter unknown errors, and the version of Hbase.thrift is changing. The advantage code is simple and
The difference between 1,http and HttpsFirst: HTTP is a Hypertext Transfer Protocol, the information is plaintext transmission, HTTPS is a secure SSL encryption transport protocolSecond: HTTP and HTTPS use a completely different way of connection,
Create a table
This CREATE TABLE statement is for creating a new table. The following is a simple format for creating a table statement:
CREATE TABLE "TableName"
("Column1" "Data type",
"Column2" "Data type",
"Column3" "Data type");
If you want to
If we create a testindex table:CREATE TABLE Testindex (i_testid INT not null,vc_name VARCHAR () not NULL);
We randomly inserted 1000 records into it, one of whichI_testid Vc_name555 ErquanLooking for records for vc_name= "Erquan"SELECT * from
If we create a testindex table:
CREATE TABLE Testindex (i_testid INT not null,vc_name VARCHAR () not NULL);
We randomly inserted 1000 records into it, one of which
I_testid Vc_name
555 Erquan
Looking for records for vc_name= "Erquan"
SELECT *
(1) Base operation of the library
View existing libraries: show databases;
Create library (set default character Set): Ccreate database name default Charset=utf8;
View the statement that created the library: show create database
1, choose the most applicable field properties, as far as possible to reduce the definition of field length, as far as possible to set the field not NULL, such as ' Province, gender ', preferably set to enum2. Use connection (join) instead of
1. Start Hiveserver2Nohup/home/hadoop/hive-1.1.0-cdh5.5.2/bin/hiveserver2 >>/home/hadoop/gtq_dir/logs/hiveserver.log 2> &1 &2. The code is as follows: Packagecn.hive;ImportJava.sql.*;/*** Created by Jieyue on 2017/12/18.*/ Public classHivejdbctest
1. PurposeWhen we strictly operate the database, we always encounter this situation, after the program restarts, the database tables have been established, do not need to be established again. At the beginning of the project, the use of the Android
In auditing, it is sometimes necessary to modify the table structure of Oracle and then create the table structure in SQL Server, and then import the data into SQL Server, in the process of modifying the table structure. Manual modification, the
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.