Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Query tuning with tablename alias

Re: Query tuning with tablename alias

From: Mark Richard <mrichard_at_transurban.com.au>
Date: Wed, 20 Nov 2002 13:19:17 -0800
Message-ID: <F001.005083FA.20021120131917@fatcity.com>


Wendy,

I have never heard of alias' providing either a performance gain or reduction. One thing I haven't verified though is the impact on hints. It has been my observation that if a table has an alias then that alias must be used in the hint. For example:

select /*+ index(user) */ *
from ctcs_user u;

Does not use an index, whereas:

select /*+ index(u) */ *
from ctcs_user u;

Does use an index.

If you queries are joining tables across instances, however, then I'd be looking there for performance issues. Oracle doesn't join across instances really - it tends to just temporarily copy one table to a different instance. (Someone technical can explain this properly).

Regards,

     Mark.

                                                                                                                   
                    "Hopper, Wendy                                                                                 
                    S"                   To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>       
                    <wendy.hopper@       cc:                                                                       
                    eds.com>             Subject:     Query tuning with tablename alias                            
                    Sent by:                                                                                       
                    root_at_fatcity.c                                                                                 
                    om                                                                                             
                                                                                                                   
                                                                                                                   
                    21/11/2002                                                                                     
                    05:13                                                                                          
                    Please respond                                                                                 
                    to ORACLE-L                                                                                    
                                                                                                                   
                                                                                                                   




Hello list.

I have recently been tasked with trying to optimize some slow performing queries (Oracle 8.1.7) for an application that generates reports in a data warehouse type environment. I have noticed in most of the queries that the table names have been aliased, but not used elsewhere in the query.

IE. SELECT table1.column1,

                      table1.column2,
                      table2.column1
       FROM     table1 A,
                      table2 B
       WHERE   table1.key = table2.key;

Are there any advantage/disadvantages to giving these tables aliases and not using them anywhere else? I am thinking that if the tables have been assigned alias names, they should be referred to by alias names, but I guess I have not seen anything documented on this officially. These queries join tables against remote tables in a different instance, if that makes a difference. Any insight on this would be great.

Thanks.

Wendy Hopper

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

   Privileged/Confidential information may be contained in this message.

          If you are not the addressee indicated in this message
       (or responsible for delivery of the message to such person),
            you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender
           by reply e-mail or by telephone on (61 3) 9612-6999.
   Please advise immediately if you or your employer does not consent to
                Internet e-mail for messages of this kind.
        Opinions, conclusions and other information in this message
              that do not relate to the official business of
                         Transurban City Link Ltd
         shall be understood as neither given nor endorsed by it.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mark Richard
  INET: mrichard_at_transurban.com.au

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (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).
Received on Wed Nov 20 2002 - 15:19:17 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US