About 11,000,000 results
Open links in new tab
  1. indexing - What is an index in SQL? - Stack Overflow

    Jun 2, 2010 · In SQL Server, a clustered index determines the physical order of data in a table. There can be only one clustered index per table (the clustered index IS the table). All other indexes on a table are termed non-clustered. SQL Server Index Basics. SQL Server Indexes: The Basics. SQL Server Indexes. Index Basics. Index (wiki)

  2. sql - How to use index in select statement? - Stack Overflow

    Jul 6, 2011 · Select * From [yourtable] With (Index(0)) Where ... Or to seek a particular index by using something like. Select * From [yourtable] With (Index(1)) Where ... The choice is yours. Look at the table's index properties in the object panel to get an idea of which index you want to use. It ought to match your filter(s).

  3. sql - How does database indexing work? - Stack Overflow

    This is where index helps us: index is used to speed up search queries by essentially cutting down the number of records/rows in a table that needs to be examined. How to create an index: CREATE INDEX name_index ON User (Name) An index consists of column values(Eg: John) from one table, and those values are stored in a data structure.

  4. indexing - How often should the indexes be rebuilt in our SQL …

    Michelle Ufford (a.k.a. "SQL Fool") 's automated index defrag script, suggested in the accepted answer, conceptually seems does the same as Ola Hallengren's SQL Server Maintenance Solution, but the latest version is in 2011.

  5. sql server - How do you check if a certain index exists in a table ...

    Apr 22, 2010 · If the hidden purpose of your question is to DROP the index before making INSERT to a large table, then this is a useful one-liner: DROP INDEX IF EXISTS [IndexName] ON [dbo].[TableName] This syntax has been available since SQL …

  6. Why use the INCLUDE clause when creating an index?

    The reason that you give two shakes about this, is that when you run your query, if you don't have the additional columns included (new feature in SQL 2005) the SQL Server has to go to the clustered index to get the additional columns which takes more time, and adds more load to the SQL Server service, the disks, and the memory (buffer cache to ...

  7. Function-based indexes in SQL Server - Stack Overflow

    Mar 4, 2014 · It's similar to the function based index, except you're first naming the complete expression and associating it with the table (creating a computed column), and then as a separate step you create an index on that column. And your queries have to use that column to …

  8. sql - How do composite indexes work? - Stack Overflow

    A composite index is like a plain alphabet index in a dictionary, but covering two or more letters, like this: AA - page 1 AB - page 12 etc. Table rows are ordered first by the first column in the index, then by the second one, etc. It's useful when you search by both columns, or by the first column. If your index is like this:

  9. sql server - Script for rebuilding and reindexing the fragmented …

    ALTER INDEX XXXMYINDEXXXX ON XXXMYTABLEXXX REORGANIZE Fragmentation 30%+ If the fragmentation value is 30% or greater then it is worth rebuilding then indexes in online mode. Rebuild all indexes in online mode for a table. ALTER INDEX ALL ON XXXMYTABLEXXX REBUILD WITH (ONLINE = ON) Rebuild one specified index in online mode for a table

  10. Reset identity seed after deleting records in SQL Server

    This is done primarily because in SQL Azure, each table has to have a primary key and identity defined. But since I have to delete some records from the table, the identity seed for those tables will be disturbed and the index column (which is auto-generated with an …

Refresh