If I run Perform on existing DB, profiler showing some odd queries, like this
ALTER TABLE [dbo].[Entity] DROP CONSTRAINT [FK_Entity_Field_Entity2];
...
then
EXEC sp_rename '[DB].[dbo].[Entity].[Field_Id]', 'TempField_Id', 'COLUMN';
ALTER TABLE [dbo].[Entity] ADD [Field_Id] uniqueidentifier;
UPDATE [dbo].[Entity] SET [Field_Id] = CAST([Entity].[TempField_Id] AS uniqueidentifier);
CREATE INDEX [Entity1_FK_Entity2] ON [dbo].[Entity] ([Field_Id] ASC);
and finally
ALTER TABLE [dbo].[Entity] DROP CONSTRAINT [DF__Entity__FileVers__023D5A04];
ALTER TABLE [dbo].[Entity] DROP COLUMN [Field_Id];
Similar queries execute for many (all) linked fields and fields included in custom indexes
It seems that DO drop/create all indexed fields and rebuild all indexes
Why?
asked
Apr 02 '14 at 08:26
Anton Guschin
73●30●30●35
Hello Anton, it seems that due to some reason DO considers this column was changed. This leads to recreation of related indexes and constraints on this column. If you can provide some model snippet causing this behavior we'll definitely investigate that.
Thx I'll try repeate it in test application