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

query help needed Expand / Collapse
Author
Message
Posted Thursday, May 15, 2014 1:59 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 8:54 AM
Points: 4,339, Visits: 3,383
Lynn Pettis (5/15/2014)
It is your style. Just reading it screams that you are always right and everyone else is wrong.

Lynn Pettis (5/15/2014)
I have been working and learning about SQL Server for over 15 years now, and I know I still have more to learn and discover about it. And I plan on using the system to its fullest which means I will use the local dialect (T-SQL) to get the most from the system. If this means rewriting the code if it has to be ported to PostgreSQL or Oracle at some point, so be it.

Lynn Pettis (5/15/2014)
You may have much to teach even me but your style simply turns me off. Which is why I won't even buy or read your books or come to watch you at conferences. Maybe if you made an effort to be nicer, more approachable online I might consider changing my attitude.

+1000 on each point



Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Post #1571517
Posted Friday, May 16, 2014 3:51 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 10:38 AM
Points: 1,945, Visits: 3,004
Views aren't "the Law of Proximity at the extreme", they're just code obfuscation. They won't allow you to easily identify the involved objects. 


I disagree. Do you understand that a VIEW is a virtual table? It is just as much a schema object as a base table. I think they are underused (along with DEFAULT, and CHECK() clauses, that is another topic).

To give an actual example, I had a client that was using a collection of 30+ tables with elaborate joins to do sales commission reports. Commission schemes can be insanely complicated! Whenever they needed a new or slight modification to a query, they had to remember if the rules said (a > b) or (a >= b), try to rewrite multi-table joins, etc.

They had started to go to hardcopy (text files really) of an old report and modify the old results. Of course this is wrong, but re-calculating the queries was a huge mess. The problem was that you could identify too many involved objects!

We put together a collection of ~7 basic views. One was a nine-table nightmare, but some of the others were pretty bad. They had good, clear names as per ISO-11179 rules; things like “Quarterly_Team_Bonus_by_Seniority” which were long, but precise. We depended on the optimizer to expand the VIEWs and do a good job.

This is another psychological law, Miller's law. It comes from the paper "The Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Processing Information" by George A. Miller of Princeton University in the 1950's. The short version is that the number of objects an average human can hold in working memory is 7 ± 2. This is not quite true, but it is a good heuristic.


Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #1571945
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse