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 |
|
under2811
Constraint Violating Yak Guru
366 Posts |
Posted - 2008-04-23 : 02:04:26
|
| Hi I m going through tunning part and fired query on table Code having 12500 rowsSET STATISTICS IO ONGOSELECT COUNT(*) FROM CodeGOSET STATISTICS IO OFFGOsp_spaceused Codegot results asTable 'Code'. Scan count 1, logical reads 60, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.Name: Code rows : 12500reserved: 7424 KBdata : 6272 KBindex_size: 1008 KBunused : 144 KBIf we creat table from select * into table syntax and then create PK on the table then why there is difference in results of index_size?got results asTable 'TestCode'. Scan count 1, logical reads 394, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.Name: TestCode rows : 12500reserved: 3208 KBdata : 3136 KBindex_size: 16 KBunused : 56 KBhere really index not playing part??? help me outT.i.A |
|
|
gwhiz
Yak Posting Veteran
78 Posts |
Posted - 2008-04-23 : 15:14:22
|
| Please post the DDL for both tables. My guess is that you either have additional indexes on the code table or for some reason the PK on the code table is not a clustered index and the one on testcode is. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-23 : 15:15:40
|
| The answer is most likely fragmentation.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|