SQL Server indexes and views

Source: Internet
Author: User

Business

Primary key:

Index:

Lock:

=========================================

A page is divided into

Page Header

Page body--store row

End of page

The page has a fixed size, but the data is not necessarily full, it is possible to fragment, that is, row-by-page

=========================================

Sort:

The store is sorted

Index maintenance costs are low: Therefore, the amount of modification is related to index maintenance.

Full table Scan:

Data storage may not be contiguous on the hardware ....

Query optimizer:

Why automatically optimize SQL, because the database stored some statistics, based on these statistics, the optimization of SQL, improve query efficiency. The index is ignored by the query optimizer because the index is sometimes built, but there is a problem with query SQL writing.

Base table: Original table

=========================================

Materialized views:

Partitioned views: Check Constraints

=========================================

1. Data files

2. A database has multiple data files

3. FILE-page-line

4. Positioning: (The process of data row positioning)--- positioning process

 1. In that data file

2. The page on the file

3. The line on the page.

5.

Primary key: is for data unique

Index: In order to query

Attention:

If the primary key: Create a clustered index (without index condition)

Unique constraint: Create a nonclustered index (without index condition)

6. Indexes also need to occupy storage space, so the number of indexes that are seen in different data columns (data types) is also different, of course, the smaller the index occupies the less space the better.

=============================================

Page-Intermediate set-index-table

With Lock:

Include Name:---can use this

=============================================

Use an index on the column you want to query

(index)--saved on the page set, the most detailed data is stored on the underlying table

Indexing is established based on query statements, so you can use the Where condition to build the index ....

==============================================

View:

Virtual table: The data itself is not stored

Temp table:

Temporary storage of data, used in a large number of stored procedures, as a temporary data storage site.

Can be used with triggers

Materialized views:

Curing a view, directly querying, can create a clustered index above the view, similar to the role of materialized views.

7. Partitioned views

  

=============================================

SQL Server indexes and views

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.