SlideShare ist ein Scribd-Unternehmen logo
1 von 21
SQL SERVER INDEX
JAJA
TOPIC
• WHAT IS THE INDEX OF DATABASE SYSTEM
• CLUSTERED INDEX VS. NONCLUSTERED INDEX
• THE STATISTICS OF INDEX
• THE COVERAGE IDNEX
• WHAT IS INDEX FRAGMENTATION
• CREATE THE RIGHT INDEX
WHAT IS THE INDEX OF DATABASE SYSTEM
I want to query customer BIG-Data
…5 min …10 min
…30 min…20 min
BEFORE AFTER
INDEX IS DECIDED DATA STORAGE STRUCTURE
HAS CLUSTERED INDEXNO INDEX
CLUSTERED INDEX VS. NONCLUSTERED INDEX
CLUSTERED INDEX NONCLUSTERED INDEX
CL01 Taipei Ken
WHERE Country=‘Taipei’
Got it CL Key value CL01
Searching …
Binary Search Tree (BST)
http://visualgo.net/bst.html
CLUSTERED AND NONCLUSTERED INDEX
BASE ON B-TREE
ANYTHING IS A DOUBLE-EDGED SWORD
RECORD
INDEX-01
Page-01
INDEX-02
RECORD001
PG01-RECORD001 PG01-RECORD001
RECORD002
PG01-RECORD002 PG01-RECORD002
BE CAREFUL INCREASE THE INDEX
THE STATISTICS OF INDEX
IT’S IMPORTANT
FOR SQL TO GUESS YOUR QUERY RESULT NUMBER
DEMO
THE COVERAGE IDNEX
INCLUDE EVERYTHING YOU USED
SELECT COLUMN
JOIN COLUMN
WHERE CONDITION COLUMN
DEMO
WHAT IS INDEX FRAGMENTATION
DEMO
CREATE THE RIGHT INDEX
PRINCIPLE
FREQUENTLY USED COLUMNS
COLUMN UNIQUENESS
COLUMN DATA TYPE

Weitere ähnliche Inhalte

Was ist angesagt?

Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
Ehtisham Ali
 

Was ist angesagt? (20)

Indexing
IndexingIndexing
Indexing
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
SQL Join Basic
SQL Join BasicSQL Join Basic
SQL Join Basic
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Oraclesql
OraclesqlOraclesql
Oraclesql
 
Postgresql tutorial
Postgresql tutorialPostgresql tutorial
Postgresql tutorial
 
Database basics
Database basicsDatabase basics
Database basics
 
Indexes in postgres
Indexes in postgresIndexes in postgres
Indexes in postgres
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
 
data abstraction in DBMS
data abstraction in DBMSdata abstraction in DBMS
data abstraction in DBMS
 
Relational database design
Relational database designRelational database design
Relational database design
 
SQL Joins and Query Optimization
SQL Joins and Query OptimizationSQL Joins and Query Optimization
SQL Joins and Query Optimization
 
MySQL: Indexing for Better Performance
MySQL: Indexing for Better PerformanceMySQL: Indexing for Better Performance
MySQL: Indexing for Better Performance
 
RDBMS
RDBMS RDBMS
RDBMS
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 

Ähnlich wie Database index(sql server)

My sql查询优化实践
My sql查询优化实践My sql查询优化实践
My sql查询优化实践
ghostsun
 
Automating Data Quality Processes at Reckitt
Automating Data Quality Processes at ReckittAutomating Data Quality Processes at Reckitt
Automating Data Quality Processes at Reckitt
Databricks
 

Ähnlich wie Database index(sql server) (20)

Sizing MongoDB Clusters
Sizing MongoDB Clusters Sizing MongoDB Clusters
Sizing MongoDB Clusters
 
Couchbase Data Platform | Big Data Demystified
Couchbase Data Platform | Big Data DemystifiedCouchbase Data Platform | Big Data Demystified
Couchbase Data Platform | Big Data Demystified
 
From SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONFrom SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSON
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
Денис Резник "Зачем мне знать SQL и Базы Данных, ведь у меня есть ORM?"
Денис Резник "Зачем мне знать SQL и Базы Данных, ведь у меня есть ORM?"Денис Резник "Зачем мне знать SQL и Базы Данных, ведь у меня есть ORM?"
Денис Резник "Зачем мне знать SQL и Базы Данных, ведь у меня есть ORM?"
 
NoSQL Data Modeling using Couchbase
NoSQL Data Modeling using CouchbaseNoSQL Data Modeling using Couchbase
NoSQL Data Modeling using Couchbase
 
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
50 Shades of Data - how, when and why Big, Fast, Relational, NoSQL, Elastic, ...
 
How to index your data right
How to index your data rightHow to index your data right
How to index your data right
 
N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0N1QL: What's new in Couchbase 5.0
N1QL: What's new in Couchbase 5.0
 
Sizing Your MongoDB Cluster
Sizing Your MongoDB ClusterSizing Your MongoDB Cluster
Sizing Your MongoDB Cluster
 
My sql查询优化实践
My sql查询优化实践My sql查询优化实践
My sql查询优化实践
 
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
 
Data Modeling IoT and Time Series data in NoSQL
Data Modeling IoT and Time Series data in NoSQLData Modeling IoT and Time Series data in NoSQL
Data Modeling IoT and Time Series data in NoSQL
 
JSSUG: SQL Sever Index Tuning
JSSUG: SQL Sever Index TuningJSSUG: SQL Sever Index Tuning
JSSUG: SQL Sever Index Tuning
 
AWS DynamoDB and Schema Design
AWS DynamoDB and Schema DesignAWS DynamoDB and Schema Design
AWS DynamoDB and Schema Design
 
50 Shades of Data - JEEConf 2018 - Kyiv, Ukraine
50 Shades of Data - JEEConf 2018 - Kyiv, Ukraine50 Shades of Data - JEEConf 2018 - Kyiv, Ukraine
50 Shades of Data - JEEConf 2018 - Kyiv, Ukraine
 
Database Performance
Database PerformanceDatabase Performance
Database Performance
 
50 Shades of Data – how, when and why Big,Relational,NoSQL,Elastic,Graph,Even...
50 Shades of Data – how, when and why Big,Relational,NoSQL,Elastic,Graph,Even...50 Shades of Data – how, when and why Big,Relational,NoSQL,Elastic,Graph,Even...
50 Shades of Data – how, when and why Big,Relational,NoSQL,Elastic,Graph,Even...
 
Deep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDBDeep Dive on Amazon DynamoDB
Deep Dive on Amazon DynamoDB
 
Automating Data Quality Processes at Reckitt
Automating Data Quality Processes at ReckittAutomating Data Quality Processes at Reckitt
Automating Data Quality Processes at Reckitt
 

Mehr von Aaron King

Mehr von Aaron King (14)

Golang start and tips
Golang start and tipsGolang start and tips
Golang start and tips
 
Jenkins vs gogs
Jenkins vs gogsJenkins vs gogs
Jenkins vs gogs
 
第一次Elasticsearch就上手
第一次Elasticsearch就上手第一次Elasticsearch就上手
第一次Elasticsearch就上手
 
Css animation
Css animationCss animation
Css animation
 
Running with emmet and scss
Running with emmet  and scssRunning with emmet  and scss
Running with emmet and scss
 
How do i imagine my site
How do i imagine my siteHow do i imagine my site
How do i imagine my site
 
網頁三本柱最終章Javascript與jquery
網頁三本柱最終章Javascript與jquery網頁三本柱最終章Javascript與jquery
網頁三本柱最終章Javascript與jquery
 
那些年網頁Ps切板的小事
那些年網頁Ps切板的小事那些年網頁Ps切板的小事
那些年網頁Ps切板的小事
 
網頁三本柱之Html與css
網頁三本柱之Html與css網頁三本柱之Html與css
網頁三本柱之Html與css
 
我的第一個Git版控
我的第一個Git版控我的第一個Git版控
我的第一個Git版控
 
3分鐘Azure search自我介紹 ( 3 min talking about Azure Search)
3分鐘Azure search自我介紹 ( 3 min talking about Azure Search)3分鐘Azure search自我介紹 ( 3 min talking about Azure Search)
3分鐘Azure search自我介紹 ( 3 min talking about Azure Search)
 
網頁基礎介紹
網頁基礎介紹網頁基礎介紹
網頁基礎介紹
 
Rails gril
Rails grilRails gril
Rails gril
 
Security.pptx [repaired]
Security.pptx [repaired]Security.pptx [repaired]
Security.pptx [repaired]
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Database index(sql server)

Hinweis der Redaktion

  1. DBCC SHOW_STATISTICS(‘{TABLE_NAME}’,’{INDEX_NAME’)