You are here: Re: Do foreign keys generate implicit indexes? « MsSQL Server « IT news, forums, messages
Re: Do foreign keys generate implicit indexes?

Posted by bobdurie@gmail.com on 09/24/07 13:14

On Sep 24, 3:25 am, "Jack Vamvas" <DEL_TO_RE...@del.com> wrote:
> Also, analyse your query requirements then apply an Indexing Strategy
>
> --
>
> Jack Vamvas
> ___________________________________
> Need an IT job? http://www.ITjobfeed.com/SQL
>
> <bobdu...@gmail.com> wrote in message
>
> news:1190404274.471197.197240@n39g2000hsh.googlegroups.com...
>
> > If i create a simple table with a foreign key constraint, does it
> > create an implicit index on that given ID? I've been told this is
> > done in some databases, but i need to know for sure if SQL Server does
> > it. Has anyone heard of this before, on any other databses perhaps?
>
> > Heres an example of how the foreign key constraint is being added:
>
> > ALTER TABLE [dbo].[administrators] WITH CHECK ADD CONSTRAINT
> > [FPSLUFSUOXZGAJOJ] FOREIGN KEY([AdministratorRoleID])
> > REFERENCES [dbo].[administratorroles] ([AdministratorRoleID])
>
> > My initial testing seems to indicate adding an index on the foreign
> > key column helps, but i need to know for sure. Any insight would be
> > greatly appreciated!
>
> > Bob

Thanks for all the responses on this, its much appreciated!!! I also
found this article which makes me realize other people have had the
same misconceptions as me :)
http://www.sqlskills.com/blogs/kimberly/2004/10/25/WhenDidSQLServerStopPuttingIndexesOnForeignKeyColumns.aspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация