79448

79448



Combining or Separating DDL Statements

Before the introduction of online DDL, it was common practice to combine many DDL operations into

a single alter table statement. Because each alter table statement involved copying and

rebuilding the table, it was morę efficient to make several changes to the same table at once, sińce

those changes could all be done with a single rebuild operation for the table. The downside was that

SQL codę involving DDL operations was harder to maintain and to reuse in different Scripts. If the

specific changes were different each time, you might have to construct a

new complex alter table

for each slightly different scenario.

For DDL operations that can be done in-place, as shown in Table 5.9, “Summary of Online Status for

DDL Operations", now you can separate them into individual ALTER TABLE statements for easier

scripting and maintenance, without sacrificing efficiency. For example, you might take a complicated statement such as:

alter table tl add index il(cl), add unique index 12(c2), change c4_old_name c4_new_name integer unsigned;

and break it down into simpler parts that can be tested and performed independently, such as:

alter table tl add index 11(cl); alter table tl add unique index i2(c2);

alter table tl change c4_old_name c4_new_name integer unsigned not nuli;

You might still use multi-part alter table statements for:

•    Operations that must be performed in a specific sequence, such as creating an index followed by a

foreign key constraint that uses that index.

•    Operations all using the same specific lock clause, that you want to either succeed or fail as a

group.

•    Operations that cannot be performed in-place, that is, that still copy and rebuild the table.

•    Operations for which you specify algorithm=copy or old_alter_table=l, to force the tablecopying

behavior if needed for precise backward-compatibility in specialized scenarios.



Wyszukiwarka

Podobne podstrony:
mb 41 MUSCLE BUILDINC.    Ą łax the ill of most men; it is sliort onoiigli to be wit
The introduction of approved antibody tests to complement diagnostic testing using PCR allows for mu
Rutę 14-3 Wearing Headphones or Earplugs During Stipulated Round The use of headphones or earplugs t
6. Primary schools and gymnasiums 6.1. 8-year primary school (before the implementation of the Act o
diagram18 3 F Diagram XVIII Showing iiow Lines unrelated can be brought INTO HARMONY BY THE INTRODUC
SCAN0086 (2) 260 Introduction to the Pronunciation of English seems m it seems impossible wants, hav
xl xl or... 11 x x ). Such terms are the result of using the modified theorems in transformations.
00391 >56fc344800cba14806c1d054f34026 395 Regret Indices and Capability Quantification capability b
GERMANYS PANTHER TANK succeed in producmg a single 1 32 m rangefmder before the end ot ihe war Devel
DC?ck CmMThe Mysttc Swordsman battles the prophet of an ancient cult ofeclt that began before t
Easy Tatting (2) Introduction The origin of tatting is somewhat of a mystery. However, it was all th
48862 page23 (3) With the introduction of dlsc brakes the Volkswagen factory meets the demands madę
246 (21) The dermatological examination is concemed with whether one or both feet are affected, the
DSCN4038 2. FOSSILS AS DATING INDICATORS Before the days of radiometrie dating, the best way of dati

więcej podobnych podstron