The setup (simplified)
public interface IHierarchical : IEntity
{
[Field(Nullable = false)]
Hierarchy Hierarchy { get; set; }
}
public interface IHierarchical<T> : IHierarchical where T : IHierarchical<T>
{
[Field]
T Parent { get; set; }
}
public class TestPerson : Entity, IHierarchical<TestPerson>
{
public Hierarchy Hierarchy { get; set; }
public TestPerson Parent { get; set; }
}
For this, I'll get 2 indexes for Parent field, which look like theese:
CREATE NONCLUSTERED INDEX [TestPerson_IHierarchical(TestPerson)_FK_Parent] ON [dbo].[TestPerson]
(
[Parent_Id] ASC
)
CREATE NONCLUSTERED INDEX [TestPerson_FK_Parent] ON [dbo].[TestPerson]
(
[Parent_Id] ASC
)
Obviously one of these indexes is redundant
asked
May 05 '12 at 10:31
xumix
425●75●76●82