aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/004_GridStore.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/004_GridStore.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 'OpenSim/Data/MSSQL/Resources/004_GridStore.sql')
-rw-r--r--OpenSim/Data/MSSQL/Resources/004_GridStore.sql68
1 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/004_GridStore.sql b/OpenSim/Data/MSSQL/Resources/004_GridStore.sql
new file mode 100644
index 0000000..6456c95
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/004_GridStore.sql
@@ -0,0 +1,68 @@
1/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
2BEGIN TRANSACTION
3
4CREATE TABLE dbo.Tmp_regions
5 (
6 uuid uniqueidentifier NOT NULL,
7 regionHandle bigint NULL,
8 regionName varchar(20) NULL,
9 regionRecvKey varchar(128) NULL,
10 regionSendKey varchar(128) NULL,
11 regionSecret varchar(128) NULL,
12 regionDataURI varchar(128) NULL,
13 serverIP varchar(64) NULL,
14 serverPort int NULL,
15 serverURI varchar(255) NULL,
16 locX int NULL,
17 locY int NULL,
18 locZ int NULL,
19 eastOverrideHandle bigint NULL,
20 westOverrideHandle bigint NULL,
21 southOverrideHandle bigint NULL,
22 northOverrideHandle bigint NULL,
23 regionAssetURI varchar(255) NULL,
24 regionAssetRecvKey varchar(128) NULL,
25 regionAssetSendKey varchar(128) NULL,
26 regionUserURI varchar(255) NULL,
27 regionUserRecvKey varchar(128) NULL,
28 regionUserSendKey varchar(128) NULL,
29 regionMapTexture uniqueidentifier NULL,
30 serverHttpPort int NULL,
31 serverRemotingPort int NULL,
32 owner_uuid uniqueidentifier NOT NULL,
33 originUUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
34 ) ON [PRIMARY]
35
36IF EXISTS(SELECT * FROM dbo.regions)
37 EXEC('INSERT INTO dbo.Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid, originUUID)
38 SELECT CONVERT(uniqueidentifier, uuid), regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, CONVERT(uniqueidentifier, regionMapTexture), serverHttpPort, serverRemotingPort, CONVERT(uniqueidentifier, owner_uuid), CONVERT(uniqueidentifier, originUUID) FROM dbo.regions WITH (HOLDLOCK TABLOCKX)')
39
40DROP TABLE dbo.regions
41
42EXECUTE sp_rename N'dbo.Tmp_regions', N'regions', 'OBJECT'
43
44ALTER TABLE dbo.regions ADD CONSTRAINT
45 PK__regions__uuid PRIMARY KEY CLUSTERED
46 (
47 uuid
48 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
49
50CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
51 (
52 regionName
53 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
54
55CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
56 (
57 regionHandle
58 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
59
60CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
61 (
62 eastOverrideHandle,
63 westOverrideHandle,
64 southOverrideHandle,
65 northOverrideHandle
66 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
67
68COMMIT