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

Home -> Community -> Usenet -> c.d.o.server -> Re: update statement PL/SQL

Re: update statement PL/SQL

From: <pobox002_at_bebub.com>
Date: 28 Apr 2005 06:24:59 -0700
Message-ID: <1114694699.218361.61790@f14g2000cwb.googlegroups.com>


DA Morgan wrote:
> pobox..._at_bebub.com wrote:
>> Reallybig wrote:
>>>I'm a newbie here. I try to update data from 1 table from another
>>>table. So I used cursor to update my employee table on Total_sale
>>>column = amount column on Sales Table where employee.empid =
>>>sales.empid. The problem is for 700,000, it took 2 hours to update.
>>>That's too long. Any Ideas or some sample codes would really
>
>> helpful.
>
>>>Thanks
>
>> Hopefully this is some kind of data warehouse, in which case you
should
>> look into materialized views.
>
> Could you please explain how without any DDL or DML you can give this
> advice?
>
> And then explain how this advice has anything to do with updating
> a table with 700,000 rows? It seems to me a materialized view is
> completely irrelevant but maybe I'm missing something.

The column total_sale is stored derived data, redundant and hence not normalized. Whenever changes to the sales table occur it will also need to be recalculated or it will be inaccurate.

Under these conditions a materialized view is an appropriate consideration and in my opinion is a better solution than what the OP is attempting to do.

-- 
MJB
Received on Thu Apr 28 2005 - 08:24:59 CDT

Original text of this message

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