aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/013_RegionStore.sql
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-19 18:09:10 +0000
committerJustin Clarke Casey2009-02-19 18:09:10 +0000
commit07609565617aa7936758acba5fd625877564a10d (patch)
tree73123e37f14fea5f171cbe04753c21758f25afc1 /OpenSim/Data/MSSQL/Resources/013_RegionStore.sql
parent* Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff)
downloadopensim-SC-07609565617aa7936758acba5fd625877564a10d.zip
opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.gz
opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.bz2
opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=3142
* Changes varchar(36) columns to UUID type in MSSQL - this will be much more efficient * ===As always, please, please backup your database before applying this patch=== * Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the review)
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/Resources/013_RegionStore.sql112
1 files changed, 112 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/013_RegionStore.sql b/OpenSim/Data/MSSQL/Resources/013_RegionStore.sql
new file mode 100644
index 0000000..ef5d4c0
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/013_RegionStore.sql
@@ -0,0 +1,112 @@
1BEGIN TRANSACTION
2
3CREATE TABLE dbo.Tmp_prims
4 (
5 UUID uniqueidentifier NOT NULL,
6 RegionUUID uniqueidentifier NULL,
7 ParentID int NULL,
8 CreationDate int NULL,
9 Name varchar(255) NULL,
10 SceneGroupID uniqueidentifier NULL,
11 Text varchar(255) NULL,
12 Description varchar(255) NULL,
13 SitName varchar(255) NULL,
14 TouchName varchar(255) NULL,
15 ObjectFlags int NULL,
16 CreatorID uniqueidentifier NULL,
17 OwnerID uniqueidentifier NULL,
18 GroupID uniqueidentifier NULL,
19 LastOwnerID uniqueidentifier NULL,
20 OwnerMask int NULL,
21 NextOwnerMask int NULL,
22 GroupMask int NULL,
23 EveryoneMask int NULL,
24 BaseMask int NULL,
25 PositionX float(53) NULL,
26 PositionY float(53) NULL,
27 PositionZ float(53) NULL,
28 GroupPositionX float(53) NULL,
29 GroupPositionY float(53) NULL,
30 GroupPositionZ float(53) NULL,
31 VelocityX float(53) NULL,
32 VelocityY float(53) NULL,
33 VelocityZ float(53) NULL,
34 AngularVelocityX float(53) NULL,
35 AngularVelocityY float(53) NULL,
36 AngularVelocityZ float(53) NULL,
37 AccelerationX float(53) NULL,
38 AccelerationY float(53) NULL,
39 AccelerationZ float(53) NULL,
40 RotationX float(53) NULL,
41 RotationY float(53) NULL,
42 RotationZ float(53) NULL,
43 RotationW float(53) NULL,
44 SitTargetOffsetX float(53) NULL,
45 SitTargetOffsetY float(53) NULL,
46 SitTargetOffsetZ float(53) NULL,
47 SitTargetOrientW float(53) NULL,
48 SitTargetOrientX float(53) NULL,
49 SitTargetOrientY float(53) NULL,
50 SitTargetOrientZ float(53) NULL,
51 PayPrice int NOT NULL DEFAULT ((0)),
52 PayButton1 int NOT NULL DEFAULT ((0)),
53 PayButton2 int NOT NULL DEFAULT ((0)),
54 PayButton3 int NOT NULL DEFAULT ((0)),
55 PayButton4 int NOT NULL DEFAULT ((0)),
56 LoopedSound uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
57 LoopedSoundGain float(53) NOT NULL DEFAULT ((0.0)),
58 TextureAnimation image NULL,
59 OmegaX float(53) NOT NULL DEFAULT ((0.0)),
60 OmegaY float(53) NOT NULL DEFAULT ((0.0)),
61 OmegaZ float(53) NOT NULL DEFAULT ((0.0)),
62 CameraEyeOffsetX float(53) NOT NULL DEFAULT ((0.0)),
63 CameraEyeOffsetY float(53) NOT NULL DEFAULT ((0.0)),
64 CameraEyeOffsetZ float(53) NOT NULL DEFAULT ((0.0)),
65 CameraAtOffsetX float(53) NOT NULL DEFAULT ((0.0)),
66 CameraAtOffsetY float(53) NOT NULL DEFAULT ((0.0)),
67 CameraAtOffsetZ float(53) NOT NULL DEFAULT ((0.0)),
68 ForceMouselook tinyint NOT NULL DEFAULT ((0)),
69 ScriptAccessPin int NOT NULL DEFAULT ((0)),
70 AllowedDrop tinyint NOT NULL DEFAULT ((0)),
71 DieAtEdge tinyint NOT NULL DEFAULT ((0)),
72 SalePrice int NOT NULL DEFAULT ((10)),
73 SaleType tinyint NOT NULL DEFAULT ((0)),
74 ColorR int NOT NULL DEFAULT ((0)),
75 ColorG int NOT NULL DEFAULT ((0)),
76 ColorB int NOT NULL DEFAULT ((0)),
77 ColorA int NOT NULL DEFAULT ((0)),
78 ParticleSystem image NULL,
79 ClickAction tinyint NOT NULL DEFAULT ((0)),
80 Material tinyint NOT NULL DEFAULT ((3)),
81 CollisionSound uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
82 CollisionSoundVolume float(53) NOT NULL DEFAULT ((0.0)),
83 LinkNumber int NOT NULL DEFAULT ((0))
84 ) ON [PRIMARY]
85 TEXTIMAGE_ON [PRIMARY]
86
87IF EXISTS(SELECT * FROM dbo.prims)
88 EXEC('INSERT INTO dbo.Tmp_prims (UUID, RegionUUID, ParentID, CreationDate, Name, SceneGroupID, Text, Description, SitName, TouchName, ObjectFlags, CreatorID, OwnerID, GroupID, LastOwnerID, OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, LinkNumber)
89 SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, RegionUUID), ParentID, CreationDate, Name, CONVERT(uniqueidentifier, SceneGroupID), Text, Description, SitName, TouchName, ObjectFlags, CONVERT(uniqueidentifier, CreatorID), CONVERT(uniqueidentifier, OwnerID), CONVERT(uniqueidentifier, GroupID), CONVERT(uniqueidentifier, LastOwnerID), OwnerMask, NextOwnerMask, GroupMask, EveryoneMask, BaseMask, PositionX, PositionY, PositionZ, GroupPositionX, GroupPositionY, GroupPositionZ, VelocityX, VelocityY, VelocityZ, AngularVelocityX, AngularVelocityY, AngularVelocityZ, AccelerationX, AccelerationY, AccelerationZ, RotationX, RotationY, RotationZ, RotationW, SitTargetOffsetX, SitTargetOffsetY, SitTargetOffsetZ, SitTargetOrientW, SitTargetOrientX, SitTargetOrientY, SitTargetOrientZ, PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, CONVERT(uniqueidentifier, LoopedSound), LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, ParticleSystem, ClickAction, Material, CONVERT(uniqueidentifier, CollisionSound), CollisionSoundVolume, LinkNumber FROM dbo.prims WITH (HOLDLOCK TABLOCKX)')
90
91DROP TABLE dbo.prims
92
93EXECUTE sp_rename N'dbo.Tmp_prims', N'prims', 'OBJECT'
94
95ALTER TABLE dbo.prims ADD CONSTRAINT
96 PK__prims__10566F31 PRIMARY KEY CLUSTERED
97 (
98 UUID
99 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
100
101
102CREATE NONCLUSTERED INDEX prims_regionuuid ON dbo.prims
103 (
104 RegionUUID
105 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
106
107CREATE NONCLUSTERED INDEX prims_parentid ON dbo.prims
108 (
109 ParentID
110 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
111
112COMMIT