Relationships & Joins / Joins & Indexing
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
We have again been emphasizing the joins within the actual database itself. Here is SQL I have the diagram view open and once again we can see each of the individual joins. I can readily see my primary key. I can see my foreign key by the infinity marker and then it defines the actual join itself. At any given time I can always shift it so that it's going to select all the rows from A, then going into the second table or I can reverse it, grab everything from SP, have that going into the A itself. Now, keep in mind, as we had mentioned before, that the indexing is going to be a key component of this. In every database that we're in, when we go down into the database level underneath to the tables and then down to the indexes, we can actually see all of the indexes that are contained within an individual table. In this particular case I can look at the specific order to know what are the best concepts to use within my joining. So it's important to have a feel for what are your indexes within the table what is the data that is contained within this table. Once I know what my data is, where my primary keys are and where my foreign relationship is, then I can start actually defining the query itself. Now, remember; we'll want to run some execution plans. Perhaps first choosing to do a right join, maybe secondly doing a left join. It all depends on the flow of the data and the layout of the schema. Remember; don't be afraid to work with the execution plan and then re-change your joins. That's what our views are all about is to let us to adjust it. It's really crucial to run the queries a few times and find out exactly what the cost is of your resources. Also remember; if you can, run that query from different sections in the office. Make sure it's not the traffic on your network that is actually interfering with it but it's the actual software component or the actual writing of the query and the structure of the joins.
Tutorial Information
| Course: | Database Optimization |
| Author: | Lauri Sowa-Matson |
| SKU: | 34078 |
| ISBN: | 1-935320-94-7 |
| Release Date: | 2010-01-06 |
| Duration: | 8 hrs / 111 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 