SQL Server Relationships and Indexes through Database Diagrams

Posted by Elliott Nash | Filed under , , , , ,

The Importance of SQL Indexes and Database Relationships

A great way to help manage your database indexes and database relationships in MS SQL Server databases is to keep a database diagram up to date. The larger you database the more important optimisation becomes. Remember its alot easier to get things right the first time round than having to go back and refactor problematic code or procedures. Sometimes you can acheive large performance increases by adding required database indexes, but be careful as adding incorrect indexes can have a negative effect on performance.

When connected through Management Studio, expand the Databases list and then expand the database you wish to work on. Right-click Database Diagrams and select New Database Diagram.

An index is basically a sorted list of key values associated with the physical address of the rows that match these key values.

Add your tables to the blank canvas, you now need to add-in the database relationships of all primary and foreign key columns in your tables. Drag and drop the column names where the SQL Server relationships exist, making sure that the correct columns are assigned.

Depending on your data and queries you may also require other columns indexed or other groups of columns. If you search on the values of two columns and index only one of them the database will have to fetch all the rows that correspond to the key you sesarched, and discard the subset of these rows that don't match the other column. By indexing both columns (called a composite index) you can eliminate this redundant process and deal only with the data we really want.

Right-click on your table and select Indexes/Keys, you can now add in single or composite indexes on your required columns.

Comments

December 20, 2009 13:14

executive travel

I was rationalizing on this issue last evening and I determined to search the WWW for some info. Your blog came up in my research and Im impressed with what you have penned on this topic.

executive travel United Kingdom

December 24, 2009 11:59

pay day loans

Nice resource. rss feed added

pay day loans United States

December 26, 2009 10:24

Wiring Diagram

Thank you for your post, this is really informative, booked !!!

Wiring Diagram United States

January 19, 2010 15:22

lacy tops

Interesting information. I will add this blog to my link exchange site.

lacy tops United Kingdom

January 28, 2010 02:37

payday loans

Master books, but do not let them master you. Read to live, not live to read.

payday loans United States

February 5, 2010 06:14

instant payday loans

Searching for this for some time now - i guess luck is more advanced than search engines Smile

instant payday loans United States

February 7, 2010 17:06

faced injection lip too

Fantastic post I hope you dont mind if I link to it from my faced injection lip too website.

faced injection lip too United Kingdom

February 15, 2010 10:17

payday loans

Fresh activity is the only means of overcoming adversity.

payday loans United States

February 27, 2010 04:48

Stretch Mark Removal

Hi
I feel enjoy at your blog. Your article very helpful for me. Keep writing and happy blogging.

Thanks
Dave

Stretch Mark Removal Zimbabwe

March 2, 2010 00:56

Webthesurfi Rugs Webdesign

very entertaining and informative blog. Ill be back..

Webthesurfi Rugs Webdesign United States

March 2, 2010 00:57

Watch Pacquiao Vs Clottey Live

your blog is very imformative and i learn a lot from it.
Thanks for sharing.

regards,

rosela

Watch Pacquiao Vs Clottey Live United States

March 2, 2010 05:33

chips facebook

i'm quite often bouncing all around the web nearly all of the day therefore I have a propensity to read a great deal, which isn't commonly a good option as nearly all of the blogs I discover are constructed of pointless nonsense copied from many other sites a thousand times, nevertheless I gotta give you props this blog is definitely not bad at all and supplies a bit of authentic information, for that reason kudos for helping to stop the fad of simply just duplicating other peoples' sites, in case you ever want to have fun with playing a few hands of zynga poker together with me just let me know - you have my e mail Smile

chips facebook United States

March 5, 2010 05:13

Stretch mark removal

Thanks for this – I really enjoyed the article and a good deal of the information here I can certainly make use of.

Regards,
Dicky

Stretch mark removal Algeria

March 5, 2010 17:54

moon in my room

Thanks for taking this opportunity to talk about this, I feel strongly about it and I benefit from learning about this subject. If possible, as you gain data, please update this blog with new information. I have found it extremely useful.

moon in my room United States

March 10, 2010 12:42

Cayla Ginsel

Stumbled into this site by chance but I’m sure glad I clicked on that link. You definitely answered all the questions I’ve been dying to answer for some time now.  Will definitely come back for more of this. Thank you so much

Cayla Ginsel United States

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading