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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to rename a table ?

Re: How to rename a table ?

From: N Prabhakar <prabhs_at_po.pacific.net.sg>
Date: 1996/12/27
Message-ID: <5a0gui$r6j@newton.pacific.net.sg>#1/1

aak2_at_Ra.MsState.Edu (Atif Ahmad Khan) wrote:
>
>I have a table that is serving data to web users around the clock.
>Its a rather huge table, has a primary key and a couple of indices also.
>
>I figured that instead of trying to update 5,000 rows in the main
>200,000 rows table, I may be better off doing it all to a temporary
>table while dropping its indices to improve performance and when I am
>done, drop the main table and rename the temporary table as the main table.
>
>Is this possible ? Also is this a good solution ? I looked up the alter
>table command in the SQL Reference manual and did not find a way to rename
>a table.
>
>Thanks in advance for any pointers.
>
>Atif Khan

Hi there,

The syatax is

rename table t1 to t1_old;

Since you are going to update only 5000 rows in a 200000 table, I feel that you should directly update the main table. Since indexes are present, the update is going to be faster (I am assuming that only non-indexed column are getting updated).

As a thumb rule, indexes are efficient only when the data affected by it is less than 15% to 20% of the entire table. My suggestion is you perform both the checks and monitor the performance and take appropriate actions.

Regards

N.Prabhakar Received on Fri Dec 27 1996 - 00:00:00 CST

Original text of this message

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