Igor,
Square hit as I remember it. I've read a couple of items from oriole corp
and while I have never found anything they've written to be wrong, they have
been less than completely clear on the why's and wherefores as in this case.
Dick Goulet
Reply Separator
Author: "Igor Neyman" <[EMAIL PROTECTED]>
Date: 7/10/2001 5:26 AM
Well, it's not aliases themselves, but the practice of using aliases as
prefixes, when referring to columns:
SELECT t1.col1, t1.col2, t2.col1
FROM table1 t1, table2 t2
WHERE t1.col2 = t2.col2
that's what saves time when parsing: this way you tell the parser which table
column list to look for, otherwise (when no prefixes used) it has to search
through all tables column lists for particular column definition (and also to
make sure, that this column name is unique in all column lists - if not you'll
be getting an error, if not using prefixes).
But, you can get the same result (save time on parsing), when using table names
as prefixes:
SELECT table1.col1, table1.col2, table2.col1
FROM table1, table2
WHERE table1.col2 = table2.col2
It's just that aliases are usually short (while table names could be long), and
it's easier to read the code.
List, please correct me, if I'm wrong.
Igor Neyman, OCP DBA
Perceptron, Inc.
(734)414-4627
[EMAIL PROTECTED]
- Original Message -
From: novicedba
To: Multiple recipients of list ORACLE-L
Sent: Tuesday, July 10, 2001 7:10 AM
Subject: table aliases save time when parsing??
Hi,
was reading CorrelatedSubqueries.pdf from oriole corp.
In fact it's good programming practice to use aliases in every situation where
more than one table is referred to in a statement, since it saves time when
parsing.
Can some one please explain how it helps?
coz
I am a
novice
Oracle Certifiable DBBS
Well, it's not aliases themselves, but the practice of using
aliases as prefixes, when referring to columns:
SELECT t1.col1, t1.col2, t2.col1
FROM table1 t1, table2 t2
WHERE t1.col2 = t2.col2
that's what saves time when parsing: this way you tell the
parser which table column list to look for, otherwise (when no
prefixes used) it has to search through all tables column lists for
particular column definition (and also to make sure, that this column name
is unique in all column lists - if not you'll be getting an error, if not using
prefixes).
But, you can get the same result (save time on parsing), when
using table names as prefixes:
SELECT table1.col1, table1.col2, table2.col1
FROM table1, table2
WHERE table1.col2 = table2.col2
It's just that aliases are usually short (while table names could be long),
and it's easier to read the code.
List, please correct me, if I'm wrong.
Igor Neyman, OCP DBAPerceptron, Inc.(734)414-4627mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED]
- Original Message -
From:
mailto:[EMAIL PROTECTED]";>novicedba
To: mailto:[EMAIL PROTECTED]";>Multiple recipients of list ORACLE-L
Sent: Tuesday, July 10, 2001 7:10
AM
Subject: table aliases save time when
parsing??
Hi,
was reading
CorrelatedSubqueries.pdf from
oriole corp.
In fact it's good programming
practice to use aliases in every situation where more than one table is
referred to in a statement, since it saves time when parsing.
Can some one please explain how it
helps?
cozI am anoviceOracle Certifiable
DBBS
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: [EMAIL PROTECTED]
Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).