- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Creating Indexes for Performance in C#
12 UPC - 13 Creator In Visual C# Using Barcode encoder for VS .NET Control to generate, create EAN-13 Supplement 5 image in .NET applications. www.OnBarcode.comEAN-13 Supplement 5 Reader In C#.NET Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET framework applications. www.OnBarcode.comCreating Indexes for Performance
Barcode Printer In Visual C# Using Barcode creation for Visual Studio .NET Control to generate, create bar code image in VS .NET applications. www.OnBarcode.comBarcode Recognizer In C# Using Barcode reader for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications. www.OnBarcode.comReal World
EAN-13 Supplement 5 Creation In .NET Framework Using Barcode maker for ASP.NET Control to generate, create EAN 13 image in ASP.NET applications. www.OnBarcode.comPrinting EAN-13 In .NET Using Barcode encoder for VS .NET Control to generate, create EAN-13 image in .NET applications. www.OnBarcode.comIt s All About the I/O
EAN-13 Supplement 5 Generation In VB.NET Using Barcode creation for .NET Control to generate, create GS1 - 13 image in .NET framework applications. www.OnBarcode.comQR Code Encoder In C# Using Barcode drawer for VS .NET Control to generate, create QR Code 2d barcode image in Visual Studio .NET applications. www.OnBarcode.comIndexes are really all about the I/O. You use indexes to decrease the number of I/O operations that you perform. When you perform a table scan, thousands or even millions of I/Os are generated. These operations are expensive. Using an index finds your data faster because there are fewer reads necessary in order to find your data. By performing fewer I/Os, performance is increased and resource utilization is reduced. Encoding ANSI/AIM Code 39 In Visual C# Using Barcode creator for VS .NET Control to generate, create Code 39 Extended image in .NET framework applications. www.OnBarcode.comMake EAN / UCC - 14 In Visual C#.NET Using Barcode generator for .NET framework Control to generate, create USS-128 image in .NET framework applications. www.OnBarcode.comThe index is created with one or more index keys. The index key is the column or columns in the table that define what is indexed. This is the value that will be used to find the data in the table quickly. It can be character strings, integers, floats, and so on. Because these keys are used as the criteria for finding the data in the table and because you don t always look for data using the same columns in your WHERE clause of your query, multiple indexes are allowed. The exception is the clustered index, which is discussed later in this chapter. You can have only one clustered index per table. Note The index key column does not support the following data types: image, ntext, and text data types. Since indexes are created on index keys, you must include the leading key values in the WHERE clause of your SQL statement in order to use an index. If you do not include the index key in the WHERE clause, that index won t be used to find your data. Specifically, the leading side of the index must be included in the WHERE clause of the SELECT statement. In addition, there are a few other restrictions that are described later in this chapter. An index that has been defined with only one key column is called a simple index. An index that has more that one key column is called a composite index. More than one column should be used in the index key if it makes the index more unique or gives it greater selectivity. The more unique the index, the better the index since it allows for fewer rows to be retrieved within the queries. As you will learn later in this chapter, indexes should be created to be as unique as possible, but very wide indexes with lots of key values are less efficient in terms of space and modification performance. Note Making EAN / UCC - 13 In Visual C#.NET Using Barcode encoder for Visual Studio .NET Control to generate, create EAN 13 image in .NET applications. www.OnBarcode.comCode-27 Drawer In C# Using Barcode generator for VS .NET Control to generate, create Rationalized Codabar image in VS .NET applications. www.OnBarcode.comThe benefit of an index is that you can find your data with as few reads as possible. The wider the index, the more index pages that it consumes, and thus it takes more space and more pages are needed to find the desired data. As a Data Matrix 2d Barcode Printer In Objective-C Using Barcode creator for iPhone Control to generate, create ECC200 image in iPhone applications. www.OnBarcode.comCreate UPC-A In VS .NET Using Barcode creator for ASP.NET Control to generate, create UPC-A image in ASP.NET applications. www.OnBarcode.comPart III
GS1 DataBar-14 Generation In .NET Framework Using Barcode printer for .NET Control to generate, create GS1 DataBar image in VS .NET applications. www.OnBarcode.comGenerating PDF-417 2d Barcode In Java Using Barcode generator for Android Control to generate, create PDF-417 2d barcode image in Android applications. www.OnBarcode.comMicrosoft SQL Server 2005 Administration
PDF417 Reader In Java Using Barcode scanner for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comPaint 1D In Visual Basic .NET Using Barcode creation for Visual Studio .NET Control to generate, create Linear Barcode image in .NET applications. www.OnBarcode.comresult, there is always a give-and-take between creating more unique indexes and creating smaller indexes. Printing GS1 - 13 In .NET Framework Using Barcode encoder for ASP.NET Control to generate, create GTIN - 13 image in ASP.NET applications. www.OnBarcode.comReading UPC - 13 In C# Using Barcode reader for .NET framework Control to read, scan read, scan image in VS .NET applications. www.OnBarcode.comAn index can be either unique or non-unique. With a unique index, there can be only one index key value; with a non-unique index, you can have duplicate index key values. For example, if the unique index were created on Lastname, Firstname, there could be only one entry for each name, a duplicate entry would be refused and an error issued. A unique index has the highest level of selectivity that an index can have, since each key value is associated with only one row, or each row has a unique key value. Any attempt to insert a duplicate index key value into a unique index will result in a failure. A set of columns that is designed to uniquely define each row in the table is called the Primary Key (PK), as mentioned in 13, Enforcing Data Integrity. The primary key is usually associated with a constraint and often is a very good candidate for a clustered index. Unfortunately, a table cannot always be defined with a primary key since it might be impossible to uniquely identify a row. There can be only one primary key per table, and the primary key cannot contain NULL values. When the primary key is defined, a unique index that is used to enforce uniqueness is created.
|
|