Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2010-02-13 : 13:40:03
|
| i have 10000 records in a table, i wants to find particular recordbased on primarykey, in this scenario , we can use indexingwhat is the use of indexing?Desikankannan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-13 : 13:43:14
|
| indexing helps searches to become faster. Its like adding index to a book so that you can search through index to find out which page contains your required information and then search within it rather than searching through all the pages.More details belowhttp://www.simple-talk.com/sql/learn-sql-server/sql-server-index-basics/------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2010-02-13 : 13:59:00
|
| hi,how to create clustred index in a table ,i have grn table wheregrn code is a primary key and i have 80000 record in that table, i wants to get grncode (25000) from the tablein this scenario how to use index, i can use clustered index or non clustered indexDesikankannan |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-02-14 : 03:03:23
|
| "i wants to find particular record based on primarykey"If you have a Primary Key then you already have an index. Is the Primary key using Clustered or Non-Clustered?You could change the table so that the PK uses a clustered index (i.e. if something else is already using a clustered index), but you would be changing the design of the system and you should have a very good reason for doing that.I very much doubt that the PK was created using a non-clustered index (i.e. there is NO clustered index on the table) - you have to go miles out of your way to create that scenario!So ... if you have a PK already and you want to retrieve a specific value it will be "instant" - whether it has Clustered or Non-clustered index.If you have performance problems retrieving a specific row by PK value then your problem is elsewhere - such as poor housekeeping maintenance. |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-02-14 : 10:44:54
|
| Attempt to do some analysis on the types of queries that will be executed against your data. This will assist in creating an index strategyJack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
|
|
|
|
|