|
-
In common the anwer is --> YES constraint will have effect on perfomance.
How u can check this:
SQL> create table employees
2 ( emp_id number,
3 salary number,
4 commission_pct number);
Table created.
Elapsed: 00:00:00.00
SQL>
SQL> declare
2 i number;
3 begin
4 for i in 1..10000 loop
5 insert into employees
6 ( emp_id, salary, commission_pct)
7 values (i, mod(i,30)*mod(i,10), 0.2);
8 end loop;
9 end;
10 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.08
SQL> ALTER TABLE employees ADD CONSTRAINT check_comp
2 CHECK (salary + (commission_pct*salary) <= 5000);
Table altered.
Elapsed: 00:00:00.00
SQL> declare
2 i number;
3 begin
4 for i in 10000..20000 loop
5 insert into employees
6 ( emp_id, salary, commission_pct)
7 values (i, mod(i,20)*mod(i,10), 0.2);
8 end loop;
9 end;
10 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.01
In this example we have a degradation of perfomance ~ 25-30%.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|