|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 4:20 AM
Points: 10,
Visits: 138
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:17 AM
Points: 6,862,
Visits: 8,049
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 11:03 AM
Points: 1,853,
Visits: 485
|
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 3:26 PM
Points: 31,425,
Visits: 13,738
|
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 1:13 PM
Points: 3,578,
Visits: 5,119
|
|
Steve Jones - Editor (11/9/2009) Great job. I hadn't heard of this when I read the article, but it makes great sense.
Yepper. I have had several clients that have benefited from indexing FKs and reducing deadlocks and/or increasing concurrency. Indexes aren't just about performance! :)
Best,
Kevin G. Boles SQL Server Consultant SQL MVP 2007-2012 TheSQLGuru at GMail
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, March 18, 2013 7:54 AM
Points: 27,
Visits: 421
|
|
Nice article, very elaborative. I want to stress : by improving performance, query will run faster and reduce required lock time, hence reducing blocking and deadlock posiibilities. If you want to understand transaction processing, Thomas Kyte -- Expert Oracle .... is the book to study, a bible.
Jason http://dbace.us
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, March 15, 2013 2:43 PM
Points: 3,924,
Visits: 1,554
|
|
Nicely written Article, Alok.
Its always a good to read any article which had combination of enough code and to-the-point explanation in it.
SQL DBA.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:31 PM
Points: 359,
Visits: 94
|
|
am not sure adding indexes on FKs. i read somewhere if your child table contains lot of unique records then there is no point of creating index as index size is same as table size in that case seeks wont be any faster than scans , am i wrong ? thanks for the advise
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 1:13 PM
Points: 3,578,
Visits: 5,119
|
|
sqlpro (11/9/2009) am not sure adding indexes on FKs. i read somewhere if your child table contains lot of unique records then there is no point of creating index as index size is same as table size in that case seeks wont be any faster than scans , am i wrong ? thanks for the advise
Yes, you are wrong. Take it to the extreme: you have a billion row child table where every single parentid value is unique. Parentid is not indexed. You need to get the ONE child row for parentid 111222333. You have no choice but to do a table scan to check every single parentid value for equality to 111222333. That cannot be efficient. Index parentid and you will probably get somewhere between 8 and 10 total page reads (btree depth) depending on the width of the child PK and parentid. The table scan without the index could well be many tens or even hundreds of thousands of pages.
Best,
Kevin G. Boles SQL Server Consultant SQL MVP 2007-2012 TheSQLGuru at GMail
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:31 PM
Points: 359,
Visits: 94
|
|
thanks for the reply. probably i misunderstood but following is the link i got my understanding from.its here http://www.informit.com/library/content.aspx?b=STY_Sql_Server_7&seqNum=145
|
|
|
|