Consultor Eletrônico



Kbase P32358: Update records to improve performance after (fast) schema change
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

Update records to improve performance after (fast) schema change

FIX:

Starting from V9, a schema update does not apply a change within the records as per the new Schema Versionning functionality.

No record update will occur on disk when there is only read (and no update) of the record. That read is "costly" as the record's update is done in memory each time.

Find below two samples of UPDATEs to execute so that the record has its latest version on disk. Assuming the table customer has around 55000 records, we choose to run several transactions instead of a huge one.


Sample 1:
One of the changes on the table "customer" is: char field "new_column" added.
Run
FOR EACH customer WHERE cust_num < 20000:
SET customer.new_column = "by-default".
END.
FOR EACH customer WHERE cust_num >= 20000 AND cust_num < 40000:
SET customer.new_column = "by-default".
END.
FOR EACH customer WHERE cust_num >= 40000:
SET customer.new_column = "by-default".
END.


Sample 2:
The only change on the table is: "field2" suppressed.
Run
FOR EACH customer WHERE cust_num < 20000:
SET customer.city = customer.city.
END.
FOR EACH customer WHERE cust_num >= 20000 AND cust_num < 40000:
SET customer.city = customer.city.
END.
FOR EACH customer WHERE cust_num >= 40000:
SET customer.city = customer.city.
END.

Because the field "city" is not part of any index, the above update will be as less costly as possible.