SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Alias yes or no for Performance
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 04/03/2007 :  08:32:24  Show Profile  Reply with Quote
quote:
Originally posted by pootle_flump

FWIW I find the stags-clashing-heads debates certainly the most entertaining and often the most informative of threads.

Maybe we can have the next one filmed by the Animal Channel. Or the Discovery Channel can have a "DBA week"!

e4 d5 xd5 Nf6
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/03/2007 :  09:04:48  Show Profile  Reply with Quote
quote:
Originally posted by Kristen

"What's the big deal"

Well ... the OP asked if there were any performance implications of using, or not using, aliases ....

... if you aren't busy you could set up a TEST !!

Kristen



I did, that's what's in the link I posted before


http://weblogs.sqlteam.com/brettk/archive/2007/03/27/60141.aspx


EDIT: What does OP Mean?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam




Edited by - X002548 on 04/03/2007 09:06:04
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 04/03/2007 :  09:31:34  Show Profile  Reply with Quote
"What does OP Mean?"

Sorry : "Original Poster"

Kristen
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/03/2007 :  09:48:51  Show Profile  Reply with Quote
quote:
Originally posted by Kristen

"What does OP Mean?"

Sorry : "Original Poster"

Kristen



Did you make that up?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 04/03/2007 :  09:56:55  Show Profile  Reply with Quote
No. "OP" has been used as a reference many times on dbforums, Brett.

e4 d5 xd5 Nf6
Go to Top of Page

pootle_flump
Flowing Fount of Yak Knowledge

United Kingdom
1064 Posts

Posted - 04/03/2007 :  11:28:52  Show Profile  Reply with Quote
... and is standard accepted forum nomenclature web wide. Where you been?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/03/2007 :  11:34:31  Show Profile  Reply with Quote
You act like I know anything...I know very few..lol, omg, HTH, etc, whatever they're called, and I'd prefer tto use the sparingly, if at all




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

harsh_athalye
Flowing Fount of Yak Knowledge

India
5509 Posts

Posted - 04/03/2007 :  12:03:52  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
I use google when I came across such unknown words. Generally, it gives me correct definition (just search for "define:IMHO", for example) but may not be always what it should be as in the case of OP.

OP: Original Poster (expected)
OP: Out of Print (google)



Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/03/2007 :  12:09:21  Show Profile  Reply with Quote
Ocean Pacific

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jezemine
Flowing Fount of Yak Knowledge

USA
2886 Posts

Posted - 04/03/2007 :  12:35:53  Show Profile  Visit jezemine's Homepage  Reply with Quote
this has just about every acronym in existence (including OP):

http://silmaril.ie/cgi-bin/uncgi/acronyms

there are a lot of great ones with origins in the military, like USMC


www.elsasoft.org
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 04/03/2007 :  13:43:18  Show Profile  Reply with Quote
"I know very few... ???"

I think the mnemonic you are grasping for is "TLA" which supposedly stands for, errmmmmm .... "Three Letter Acronyms". The more Pedant. amongst you will have already worked out that "OP" has only two letters ...

But there are other definitions of "TLA" - such as "Those Little Abbreviations" (as well as "Three Letter Abbreviation" which is probably more appropriate for the non-pronounceable TLA's - Damn! Recursion error strikes again ...)

So there you half-have-it!

Kristen
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 04/03/2007 :  13:52:00  Show Profile  Reply with Quote
hahaha ... serendipity has provided a current worked example:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81395

Kristen
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 04/03/2007 :  14:24:13  Show Profile  Reply with Quote
Now, I have heard of TLAs. I have even heard of ETLAs (Extended Three Letter Acronym) which cover 4 or more letter acronyms (like that slot on the side of laptops...pcmiaeieio, or something), but I am not sure if there is an acronym for the humble two letter acronym.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 04/03/2007 :  14:56:49  Show Profile  Reply with Quote
HA?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam




Edited by - X002548 on 04/03/2007 14:57:31
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30186 Posts

Posted - 04/03/2007 :  15:07:16  Show Profile  Visit SwePeso's Homepage  Reply with Quote
quote:
Originally posted by X002548

HA?
Do not like their logo to be copied onto clothes.
Threats have been made at store clerks, where the store sell clothes with skulls resembling their logo.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 04/04/2007 :  01:16:23  Show Profile  Reply with Quote
"I am not sure if there is an acronym for the humble two letter acronym"

How about "TLA"?
Go to Top of Page

jezemine
Flowing Fount of Yak Knowledge

USA
2886 Posts

Posted - 04/04/2007 :  02:17:03  Show Profile  Visit jezemine's Homepage  Reply with Quote
works as well for the somewhat less common thirty letter acronym...


www.elsasoft.org
Go to Top of Page

MutantNinjaLoungeSinger
Starting Member

14 Posts

Posted - 04/06/2007 :  17:48:36  Show Profile  Reply with Quote
On topic... I imagine there probably is some minor overhead to parsing and handling of an alias. How much of that overhead is noteworthy is probably close to zero. If you're to the point where you need to shave milliseconds off your query, then I imagine there are far worse issues with what you're trying to do than worrying about an alias.

on the other topic discussed here...

If you're writing your own throw-away queries that you know for sure you'll be the only one utilizing, then great.. alias all you want. Use single letters or whatever.

However, if you're writing scripts or stored procedures that will be seen or possibly be a target of trouble shooting by someone other than yourself (everyone needs to go on a vacation now and then, right?), you need to take yourself and your preferences out of the picture, and look at it from a more enterprise-level persepctive.

For what it's worth, I completely agree with blindman and all of the points he's making. His viewpoints and practices are much more responsible from a much higher perspective than many developers/DBAs can comprehend. One of the harsh realities of our industry is, many times you will have no control over the skill-level of the person that will look at your code after you leave, or go on vacation. So, short of writing elaborate documentation before you leave (which well-expressive code would provide anyway), you will get a phone call on your vacation if something goes wrong. That call can be completely avoided by coding in a way that is expressive and self documenting, and discourages looking back-and-forth between what you're aliasing, and what it means.

When the aliases are hidden away in the first page of text and your back-up person is on page 6, and is probably unfamiliar with the code, s/he is going to have to do a lot of back-and-forth to decipher what's going on.

AFTER they figure that part out, THEN they might even be able to tackle what the real problem was (or rather, why they've had to poke around in your code to begin with)

People who disagree have either never had to maintain a monolithic procedure, or have just accepted it as a standard practice rather than asking the question of "what could have been done to allow me to fix this bug sooner so the next person that looks at it can avoid those issues" Most of the time it's because of code that's hard to follow, and a lot of the times, single letter, non-expressive aliases are usually a major culprit.

Aliases aren't bad, just make sure you've used it for something other than saving yourself keystrokes (as blindman has pointed out as well). Terse aliases tell me nothing on page 6. It promotes this method of problem solving... "What does C mean here again? Crap.. I need to go back to the top to find it. Oh. C means "customer" this time. Where was I again?"

Furthermore, who says your first pass is the one that finds it's way to production and you can't compromise?

Code in the style you're used to (following test-driven-development standards), and alias any way you want when you're developing. But BEFORE you deem it production worthy, look out for who's going to look at your code in the future, and re-factor it to be expressive. Retain EXPRESSIVE aliases when necessary, and remove the ones that can't be expressed any better than the original name.

Go to Top of Page

rockmoose
SQL Natt Alfen

Sweden
3279 Posts

Posted - 04/06/2007 :  19:38:07  Show Profile  Reply with Quote
Hey, blindman, you got support!!!

I love your sig MNLS , but al(i)as I don't buy into the approach of spelling out every letter.

rockmoose
________________________________________________________________
FROM <tableexpression>
WHERE <conditionlist>
SELECT <columnlist>

Edit: spelling

PS. nice quote mvj , could not google it though..

Edited by - rockmoose on 04/07/2007 04:39:15
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 04/06/2007 :  21:37:39  Show Profile  Reply with Quote
Sayre’s Law: "In any dispute the intensity of feeling is inversely proportional to the value of the stakes at issue"
Wallace S. Sayre





CODO ERGO SUM
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000