Click here to Skip to main content
15,892,059 members
Home / Discussions / Database
   

Database

 
Questionconnection string, ip, remote server connection Pin
steve_rm3-Jan-07 17:17
steve_rm3-Jan-07 17:17 
AnswerRe: connection string, ip, remote server connection Pin
Uri Lavi4-Jan-07 1:03
Uri Lavi4-Jan-07 1:03 
QuestionOptimization of INNER JOIN Pin
PIEBALDconsult3-Jan-07 11:31
mvePIEBALDconsult3-Jan-07 11:31 
AnswerRe: Optimization of INNER JOIN Pin
Chris Meech3-Jan-07 11:46
Chris Meech3-Jan-07 11:46 
GeneralRe: Optimization of INNER JOIN Pin
PIEBALDconsult4-Jan-07 3:47
mvePIEBALDconsult4-Jan-07 3:47 
AnswerRe: Optimization of INNER JOIN Pin
Mark J. Miller3-Jan-07 11:58
Mark J. Miller3-Jan-07 11:58 
GeneralRe: Optimization of INNER JOIN Pin
PIEBALDconsult4-Jan-07 5:46
mvePIEBALDconsult4-Jan-07 5:46 
GeneralRe: Optimization of INNER JOIN Pin
Mark J. Miller4-Jan-07 6:22
Mark J. Miller4-Jan-07 6:22 
That is where the cost estimator comes in. The query optimizer will choose the same plan either way based on the cost. If the table statistics (or the lack thereof) show that it will be more effective to filter the results from the employee table first then join to addresses it will do that in both cases. However, if the number of rows in the address table is less than the number of employees in the sales department then the optimizer may decide to pull all the rows from the address table and use them to filter the results from the employee table and then apply the filter on department.

The question is simply: how will the query optimizer interpret the statement based on the data provided by the cost estimator? Unless you enforce join order by using a join hint, the query optimizer will choose the best join order for the plan based on the cost data. If you want to enforce join order, then you will effectively tie the optimizer's hands and bend it to your will.

But no matter what you do the temporary table from the employee table will only ever contain the rows from the sales department. The statement is only parsed in the order you write it, then it becomes a data structure used by the query optimizer which is why, in this case it doesn't matter weither your filter is contained w/in the WHERE clause or the JOIN clause.

If you use SET STATISTICS IO ON you will see that the logical IO is the same either way, combine this with the execution plan of both queries and that tells me that there is no difference between the two statements at all.


Questionsql instances on LAN in combo in vb.net [modified] Pin
Hasan Jaffal3-Jan-07 10:24
Hasan Jaffal3-Jan-07 10:24 
AnswerRe: sql instances on LAN in combo in vb.net Pin
Hasan Jaffal4-Jan-07 4:05
Hasan Jaffal4-Jan-07 4:05 
QuestionDataset not saving the changes Pin
Irfan Faruki3-Jan-07 9:23
Irfan Faruki3-Jan-07 9:23 
AnswerRe: Dataset not saving the changes Pin
Mark J. Miller3-Jan-07 11:39
Mark J. Miller3-Jan-07 11:39 
GeneralRe: Dataset not saving the changes Pin
Irfan Faruki3-Jan-07 22:01
Irfan Faruki3-Jan-07 22:01 
QuestionBulk copy on Sql mobile 2005 Pin
Filip Landr2-Jan-07 21:14
Filip Landr2-Jan-07 21:14 
QuestionSQL Query not work Pin
jaganil2-Jan-07 21:12
jaganil2-Jan-07 21:12 
AnswerRe: SQL Query not work Pin
Elina Blank3-Jan-07 3:32
sitebuilderElina Blank3-Jan-07 3:32 
AnswerRe: SQL Query not work Pin
ChandraRam3-Jan-07 23:16
ChandraRam3-Jan-07 23:16 
QuestionMs-Sql data optimization Pin
vijaymuthu2-Jan-07 18:59
vijaymuthu2-Jan-07 18:59 
AnswerRe: Ms-Sql data optimization Pin
Pete O'Hanlon2-Jan-07 22:27
mvePete O'Hanlon2-Jan-07 22:27 
QuestionSet default database and log locations in SQL Server Management Studio Express Pin
kani982-Jan-07 13:11
kani982-Jan-07 13:11 
QuestionScript/tool to update schema of my database when the latest_schema script is provided Pin
PrashantJ2-Jan-07 5:10
PrashantJ2-Jan-07 5:10 
QuestionRegarding dataset Pin
Member 22045442-Jan-07 4:14
Member 22045442-Jan-07 4:14 
AnswerRe: Regarding dataset Pin
Pete O'Hanlon2-Jan-07 4:42
mvePete O'Hanlon2-Jan-07 4:42 
QuestionRetrieve Table names from Access database? Pin
kbalias2-Jan-07 1:19
kbalias2-Jan-07 1:19 
AnswerRe: Retrieve Table names from Access database? Pin
Paul Conrad2-Jan-07 7:34
professionalPaul Conrad2-Jan-07 7:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.