Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

CROSS JOIN vs INNER JOIN performance issue. Expand / Collapse
Author
Message
Posted Friday, May 17, 2013 9:14 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Monday, November 3, 2014 1:52 AM
Points: 720, Visits: 553
So should I say that it is the old way of INNER JOINing tables, that will not be supported in future versions !!

Also, when we write "x IN (2,4,6)", optimizer converts it into "x=2 OR x=4 OR x=6", we can see it in execution plan. Does Sql store this optimized query somewhere?
Post #1454058
Posted Friday, May 17, 2013 9:24 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:21 AM
Points: 40,597, Visits: 37,054
T.Ashish (5/17/2013)
So should I say that it is the old way of INNER JOINing tables, that will not be supported in future versions !!


It's the old way, but it's not deprecated.

Also, when we write "x IN (2,4,6)", optimizer converts it into "x=2 OR x=4 OR x=6", we can see it in execution plan. Does Sql store this optimized query somewhere?


The execution plan is cached in the plan cache.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1454061
Posted Friday, May 17, 2013 9:27 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:09 AM
Points: 2,876, Visits: 5,201
T.Ashish (5/17/2013)
So should I say that it is the old way of INNER JOINing tables, that will not be supported in future versions !!

No, that's incorrect. The older (non ANSI) version of outer joins using =* and *= is deprecated. You should be able "INNER JOIN" in where clause...

Also, when we write "x IN (2,4,6)", optimizer converts it into "x=2 OR x=4 OR x=6", we can see it in execution plan. Does Sql store this optimized query somewhere?


Yes it does. In a query plan cache. You can access it using sys.dm_exec_text_query_plan





_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1454063
Posted Friday, May 17, 2013 9:46 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 12:34 AM
Points: 20,857, Visits: 32,871
Eugene Elutin (5/17/2013)
T.Ashish (5/17/2013)
So should I say that it is the old way of INNER JOINing tables, that will not be supported in future versions !!

No, that's incorrect. The older (non ANSI) version of outer joins using =* and *= is deprecated. You should be able "INNER JOIN" in where clause...

Also, when we write "x IN (2,4,6)", optimizer converts it into "x=2 OR x=4 OR x=6", we can see it in execution plan. Does Sql store this optimized query somewhere?


Yes it does. In a query plan cache. You can access it using sys.dm_exec_text_query_plan





Actually outer joins using =*, *=, and *=* are the ANSI 89 style joins and are no longer support in SQL Server since the release of SQL Server 2005 (well, it is supported when you run in compatibility mode 80 iirc).



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1454070
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse