actions are automatically run if the free space is greater than 25%,sql server. So this feature prevents the data from requesting too much space and not using it. For a system with a very tight disk space, this setting is undoubtedly helpful. But from the database's own health and performance considerations, this setting is not recommended for multiple use. This is because:1. SQL Server will grow automatic
. Start a page restore from a full database backup, file backup, or filegroup backup that contains the page. In the Restore DATABASE statement, use a page clause to list the page IDs of all the pages that you want to restore.Page= ' Filepage '3. Apply the most recent differential backup.4, apply the subsequent log backup.5. Create a new database tail-log backup.6, restore the new tail day backup. After you apply this new log backup, the page restore is complete and you can start to access the pa
SQL Optimization-logical Optimization-view rewriting and equivalent predicate rewriting, SQL Predicate
1) view Rewriting
View type:
A) a view constructed in SPJ format is called a simple view.
Create view v1 as select x, y, z FROM t;
B) A View (with operations such as GROUPBY) constructed in non-SPJ format i
only take the corresponding referenced relationship R in the existing primary key value.
④ user-defined integrity (user-definedintegrity): User-added restrictions
user-defined integrity is based on the requirements of the application environment and the actual needs of a specific application of the data involved in the binding conditions. This constraint mechanism should generally not be provided by the application, but should be defined and tested by the relation
"annual Salary"From EMP ORDER by 3 DESC;SELECT ename,job,sal from emp ORDER by Job,sal DESC;SELECT ename,job,sal from emp ORDER by Empno;Modify Default display widthSET line[size] {80|n}SET Line 100L display the SQL statement in the buffer you just enteredN Text modified section of error'/' (run) commandSAVEGET@ or Start command when the specified script file contents are loaded into the SQL buffer to runS
9787121062964
27
Microsoft SQL Server 2005 Technology Insider: Query, tuning, and optimization
9787121089718
28
Microsoft SQL Server 2008 Technology Insider: T-SQL language Basics
9787121095931
29
Microsoft SQ
the data object
Partition_number
Partition code
Rows
Approximate number of rows of data
hobt_id
Storage unit ID of the heap or B-tree where the data is stored
Let's find a database to look at the fragmentation situation:You can see that the arrows refer to this row of data, the theory should be a zone on it, but in fact it establishes two partitions ... So this situation can be considered to defragment, to rebuild, to release deb
optimization scheme (http://www.cnblogs.com/huangye-dream/archive/2013/05/21/3091906.html) Viii. explain viewing index usage in SQLSince the index is important, but there is no index in the SQL execution process, this can be viewed using explain, using the method: Explain SELECT * FROM table_name; is to add explain before the SELECT statement.My local test explain SELECT * from w1000 where id = ' 0000c51e-
feature is set, SQL Server checks file usage every half hour. DBCC SHRINKFILE actions are automatically run if the free space is greater than 25%,sql server. So this feature prevents the data from requesting too much space and not using it. For a system with a very tight disk space, this setting is undoubtedly helpful. But from the database's own health and performance considerations, this setting is not r
SQL Optimization-logical Optimization-subquery optimization (MySQL) and sqlmysql
1) subquery concept:When a query is a subquery of another query, it is called a subquery (a query statement is nested in the query statement ).
Subqueries are located:
A) Target column position: If a subquery is located in the target
SQL Optimization-logical Optimization-external connections, nested connections, and elimination of connections, SQL nesting
1) eliminate external connections
① External connection Introduction
1) left join/left outer join: LEFT OUTER JOIN
The result set of left outer Join includes all rows in the LEFT tabl
Original: SQL Server Enterprise Platform Management Practice book Notes--sql Server database file allocation method1, file allocation methods and file space Check methodThe most common commands for checking data files and table sizes are: sp_spaceusedThis command has three defects: 1, the use of each data file and log file is not visible. 2, this stored procedure
are most appropriate for the database business requirements. This figure shows 4 filegroups, one at a time, for each filegroup. Their backup order (a, C, B, a) reflects the business requirements of the database.Under the full recovery model, restoring a filegroup backup requires not only restoring the filegroup backup itself, but also restoring all log backups from the last full database backup to the target point in time of recovery. To ensure that the file remains consistent with the rest of
Database optimization-SELECT optimization for SQL optimization-mysql internal optimization policy bitsCN.com
Database Bottlenecks often occur in query statements. when such problems occur, the general step is to check whether the correct index is used,
You can use the explai
environments may run with the following error message. For SQL Monitor's active format report, the online approach is still recommended, and offline viewing allows the script to be downloaded locally. If the report shows an error as follows: For online viewing, it may be a question of the generated report format and see if these options are set beforehand. Set Trimspool on Trim on Set pages 0 Linesize 1000 Set Long 1000000 longchunksize 100000
Artificial Intelligence automatic SQL optimization tools-SQLTuning for SQL Server, SQL-sqltuning
In response to this situation, the artificial intelligence automatic SQL optimization tool came into being. Now I will introduce this
rules:
A) If the result of the upper query is not duplicated (that is, the main code is included in the SELECT clause), you can expand its subquery. And the distinct flag should be added before the SELECT clause of the expanded query.
b) If there is a distinct flag in the SELECT statement for the upper query, the subquery can be expanded directly.
If the inner query result does not have a repeating tuple, you can expand it.
Specific st
Optimization of Max ()For example: Explain select Max (' Payment_date ') from payment; The number of rows that can be viewed to row is very much, which means that the entire table is scanned.Add an index to payment_date.CREATE INDEX Idx_payment on payment (' payment_date ');Execute SQL statement explain select MAX (' Payment_date ') from payment order by Payment_date; You can see that rows is null.Extra:sel
16. Simple SQL Optimization for mysql partitions 2. SQL Optimization for mysql partitions
1. index classification B-Tree supports HASH. Only memory supports R-Tree myisam and supports Full-text myisam (Full-text index. only the "=" condition in the Memory engine uses the index ======================== === Data Import
≤8)
Ext_size
Size of the extents, in page units
object_id
The ID of the database object
index_id
Represents the type of the data object
Partition_number
Partition code
Rows
Approximate number of rows of data
hobt_id
Storage unit ID of the heap or B-tree where the data is stored
Let's find a database to look at the fragmentation situation:You can see that the arrows refer to
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.