add 3 migrations, 1 each for prims, primshapes, and primitems

to move all their UUID stores from varchar(255) -> char(36).  Based
on past evidence, this should help with performance.
0.6.0-stable
Sean Dague 2008-07-03 19:41:01 +00:00
parent 8eb57b68f3
commit a9b3c2582a
3 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,25 @@
BEGIN;
ALTER TABLE prims change UUID UUIDold varchar(255);
ALTER TABLE prims change RegionUUID RegionUUIDold varchar(255);
ALTER TABLE prims change CreatorID CreatorIDold varchar(255);
ALTER TABLE prims change OwnerID OwnerIDold varchar(255);
ALTER TABLE prims change GroupID GroupIDold varchar(255);
ALTER TABLE prims change LastOwnerID LastOwnerIDold varchar(255);
ALTER TABLE prims add UUID char(36);
ALTER TABLE prims add RegionUUID char(36);
ALTER TABLE prims add CreatorID char(36);
ALTER TABLE prims add OwnerID char(36);
ALTER TABLE prims add GroupID char(36);
ALTER TABLE prims add LastOwnerID char(36);
UPDATE prims set UUID = UUIDold, RegionUUID = RegionUUIDold, CreatorID = CreatorIDold, OwnerID = OwnerIDold, GroupID = GroupIDold, LastOwnerID = LastOwnerIDold;
ALTER TABLE prims drop UUIDold;
ALTER TABLE prims drop RegionUUIDold;
ALTER TABLE prims drop CreatorIDold;
ALTER TABLE prims drop OwnerIDold;
ALTER TABLE prims drop GroupIDold;
ALTER TABLE prims drop LastOwnerIDold;
ALTER TABLE prims add constraint primary key(UUID);
ALTER TABLE prims add index prims_regionuuid(RegionUUID);
COMMIT;

View File

@ -0,0 +1,9 @@
BEGIN;
ALTER TABLE primshapes change UUID UUIDold varchar(255);
ALTER TABLE primshapes add UUID char(36);
UPDATE primshapes set UUID = UUIDold;
ALTER TABLE primshapes drop UUIDold;
ALTER TABLE primshapes add constraint primary key(UUID);
COMMIT;

View File

@ -0,0 +1,31 @@
BEGIN;
ALTER TABLE primitems change itemID itemIDold varchar(255);
ALTER TABLE primitems change primID primIDold varchar(255);
ALTER TABLE primitems change assetID assetIDold varchar(255);
ALTER TABLE primitems change parentFolderID parentFolderIDold varchar(255);
ALTER TABLE primitems change creatorID creatorIDold varchar(255);
ALTER TABLE primitems change ownerID ownerIDold varchar(255);
ALTER TABLE primitems change groupID groupIDold varchar(255);
ALTER TABLE primitems change lastOwnerID lastOwnerIDold varchar(255);
ALTER TABLE primitems add itemID char(36);
ALTER TABLE primitems add primID char(36);
ALTER TABLE primitems add assetID char(36);
ALTER TABLE primitems add parentFolderID char(36);
ALTER TABLE primitems add creatorID char(36);
ALTER TABLE primitems add ownerID char(36);
ALTER TABLE primitems add groupID char(36);
ALTER TABLE primitems add lastOwnerID char(36);
UPDATE primitems set itemID = itemIDold, primID = primIDold, assetID = assetIDold, parentFolderID = parentFolderIDold, creatorID = creatorIDold, ownerID = ownerIDold, groupID = groupIDold, lastOwnerID = lastOwnerIDold;
ALTER TABLE primitems drop itemIDold;
ALTER TABLE primitems drop primIDold;
ALTER TABLE primitems drop assetIDold;
ALTER TABLE primitems drop parentFolderIDold;
ALTER TABLE primitems drop creatorIDold;
ALTER TABLE primitems drop ownerIDold;
ALTER TABLE primitems drop groupIDold;
ALTER TABLE primitems drop lastOwnerIDold;
ALTER TABLE primitems add constraint primary key(itemID);
ALTER TABLE primitems add index primitems_primid(primID);
COMMIT;