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 «««123

Am I taking crazy pills? Dispute over inner vs. outer join. Expand / Collapse
Author
Message
Posted Saturday, February 15, 2014 4:08 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 4:48 AM
Points: 14,802, Visits: 27,278
TheGreenShepherd (2/14/2014)
Yeah, I know, it's non-SARGable. That was really my last line of defense for shooting this idea down, because his next suggestion is to make that column non-nullable, and default the values to -1, which also seems like a bit of a hack.


I've actually seen this work. It's not a hack at all to have a design that doesn't allow for ANY null values. In fact, it's considered a bit more of a pure design that way. But, as with all things, it's a giant pain to maintain and default values are very difficult to define.

But stay away from functions on columns in the JOIN and WHERE criteria. That's a classic code smell.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1541835
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse