Label:A few days ago when modifying DB table, someone had suggested, for example:ALTER TABLE partially_shipment ADD CONSTRAINT FOREIGN KEY (modified_user_id) REFERENCES USERS (user_id)Such a statement, where the fk_users405 is today to say the name of some of the problems, from the previous xfk_partially_shipment to the above written. Because it is the DBA's naming convention that exists within the system, it is equivalent to the company's code convention. In this case, the answer is this:Se
Defined:SQL is an abbreviation for Structured query Language (Structured Query language). SQL is a set of operational commands built for the database and is a fully functional database language.Characteristics:1. In the database system, SQL statements are case-insensitive (uppercase is recommended). However, string constants are case-sensitive. Recommended command uppercase, table name Library name lowercase;2. SQL statements can be written in single or multiple lines, with ";" End. Keywords can
Label:Three paradigms Reference URL: Http://www.cnblogs.com/linjiqin/archive/2012/04/01/2428695.html (1). First paradigm (ensuring that each column remains atomic) Each column is the smallest atom that is non-detachable in a program. (2). Second paradigm (ensure that each column in the table is related to the primary key) (3). Third paradigm (ensure that each column is directly related to the primary key column, not indirectly) T-SQL statement: Creating database: Create Database mytest( library
Select is fetched directly on the index column . Avoid The InnoDB table is indexed two times for lookups. Select A, B from tab where c = xxx;CREATE INDEX index_name on tab (C, a, b);can be the random Io is converted to sequential io. try to avoid using foreign keys :When a foreign key is established, an index is automatically created on the external key;FOREIGN KEY constraints are not recommended, but are indexed on the associated columns between tables ;This article is from the "90SirDB" blog,
. parameter must be an integer constant. Given two parameters, the first parameter specifies the offset of the first return record row, and the second parameter specifies the maximum number of rows to be returned for a record Limit 1000,10//retrieves the record line 1001-1010, the greater the offset, the slower
Featured pagination
Paging Mode 1:
SELECT * FROM table WHERE ID >= (SELECT id from table limit 10000,1) limit; ID is the primary key query speed is relativ
same as the scalar query. 5. No view in select contains rownum create or Replace view .... Select RowNum Impact predicate push + view Merge 6. It is forbidden to have order by in the view Interference Execution Plan 7. It is forbidden to apply more than 2 views, because the innermost view changes the high cohesion and low coupling which may affect the outermost If the innermost view problems, then call this view of SQL all problems, rewrite code to kill you 8. In exists, no in not exists rewrit
index of the table is the primary key column, the name of the primary key has already been mentioned before, and the index name is the same as the primary key name (pk_ table name)
For nonclustered indexes on a table, it is recommended to use (ix0_ table name, ix1_ table name) ...., so go on, so also very clearly expressed the index, for many named articles mentioned in the need for detailed expression of specific columns, I personally feel no need, first clustered index often involves mult
the excessive consumption of CPU context switches in high concurrency scenarios.Single instance QPS throughput is generally controlled within 20000/s, and write volumes also need to be considered from the library latency issue, for the mysql5.6 version you can consider the sub-library and then sub-table, take full advantage of the 5.6 version of the library-level multi-threaded replication, thereby increasing the throughput of writes.4. Disk spaceservers typically host multiple DB instances, so
single sheet——— Scripting ————— –In scripting, it is forbidden to perform complex calculationsIn scripting, avoid using SELECT *: Reduce the number of queries and unnecessary returnsIn scripting, it is forbidden to perform calculations on indexed columnsUse fewer cursorsUse fewer triggersIn scripting, the parameter types and column types in the table need to be consistentscripting, avoid splicing SQL, using parametric processingIn scripting, minimize the number of join tablesIn scripting, limit
(
1
,‘col2‘
,‘col3‘
);Update/delete
Each field occupies one row, and a comma is written in front of the field.
The equal sign "=" leaves a space around.
If multiple and/or > * are present in the where condition, each condition occupies one row and and/or at the top of the row.
Keyword update, set, where, and etc right-aligned (Update/delete)
UPDATE table1
SET‘test‘
‘test‘
WHERE1;2. Some development recommendations
Re
CACHE; Reduce lock table time especially MyISAM; you can use multicore CPUs.9. Multiple alter operations on the same table must be combined into a single operation.10. Use as few stored procedures, triggers, views, custom functions, etc. as possible.These advanced features have performance issues and many unknown bugs. Putting the business logic into the database makes the database DDL, scale out, sharding, and so on more difficult.other1. The application account that controls super privileges
statement to force an index or use ignore index (indexname) to force MySQL to ignore the indexKey_len: The length of the index used. The shorter the length the better, without loss of accuracyRef: Shows which column of the index is being used and, if possible, a constantRows:mysql the number of rows that must be checked to return the requested dataExtra: The meaning of the returned description2. Try to replace the "in" of the subquery condition with the "inner join" query to prevent the databas
the {Pgid of their child processes. When a child process calls the Exec series of functions, the parent process can no longer set its pgid. 2.4 Session 2.4.1 Definition: Some associated process groups will form a session \ Implementation: Non-leader processes can call this function to create new sessions. Implementation feature: The calling process becomes the leader of the session, at which point the process is the only member of the new conversation. Create a new
First, the table name should not be mixed with case (that is, camel), you should use an underscore as a connector.Because in thinkphp, the M (' Table name ') method, the case of this form of table name will automatically be converted into an underscore form, resulting in unreadable, can only use the M () empty method to operate the database, it will bring a lot of inconvenience to the development of the later.second, pay attention to SQL keyword very much ,like (likes number, SQL keyword is fuzz
Easy response to ws-security specification interoperability challenges, part 1th: Overview of issues and four available solutions
Overview of Interoperability issues
Most interoperability issues do not originate from the underlying Web service specification, which is already fairly mature and stable, but are caused by a variety of ws-* Web service extension specifications, such as ws-security. As these st
What do you need to know about the JS code specification that Google publishes?
Translation | Whiteyin
Translation | Https://github.com/WhiteYin/translation/issues/10
Google has published a JS code specification for people who are not familiar with code specifications. It lists the best practices you should do to write code that is simple and understandable.The code
onvif Specification Chinese IntroductionCategory: IPNC product design 2012-11-08 14:54 16393 People read review (5) Favorite Report
Directory (?) [+] What is the implementation mechanism of the ONVIF ONVIF Specification onvif specification of the content of the project based on the ONVIF specification what is ONVIF?
Th
Synchronized from: http://www.blogjava.net/AndersLin/archive/2006/08/14/63551.html
I have discussed service and object and the associated logic in domain model of small discussion area (ke, I have fixed some points in this article and put them up when appropriate ). Association logic is the focus of this article -- Specification1. Starting from domain driven design (DDD)This specification comes from DDD, which has three
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.