Book Image

SQL Server on Linux

Book Image

SQL Server on Linux

Overview of this book

Microsoft's launch of SQL Server on Linux has made SQL Server a truly versatile platform across different operating systems and data-types, both on-premise and on-cloud. This book is your handy guide to setting up and implementing your SQL Server solution on the open source Linux platform. You will start by understanding how SQL Server can be installed on supported and unsupported Linux distributions. Then you will brush up your SQL Server skills by creating and querying database objects and implementing basic administration tasks to support business continuity, including security and performance optimization. This book will also take you beyond the basics and highlight some advanced topics such as in-memory OLTP and temporal tables. By the end of this book, you will be able to recognize and utilize the full potential of setting up an efficient SQL Server database solution in your Linux environment.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Clustered index


A clustered index sorts and stores the data rows of the table in an order based on the clustered index key. The clustered index is implemented as a B-tree where every page in a tree is called an index node. Because a clustered index determines the order in which table rows are actually stored, each table can have only one clustered index, and the table's rows cannot be stored in more than one order.

Because you can have only one clustered index per table, you must ensure that you use it to achieve the maximum benefits. Before you create a clustered index, you need to understand how your data will be accessed.

Clustered indexes are most effective when used to support queries that do the following:

  • Return a range of values by using operators such as BETWEEN, >, >=, <, and <=
  • Return data sorted using the ORDER BY or GROUP BY clause
  • Return data combined by using JOIN clauses; typically these are foreign key columns
  • Return large result sets

Note

When you define a PRIMARY KEY...