FAQ Database Discussion Community

More than one indexes on same column in SQL server

If we create one more non-clustered index on a column which already have one in SQL server, what Would be the effect of that?

Does the order of columns in an multicolumn non-clustered index matter in SQL Server?

Does the order of columns in a multi-column nonclustered index created for a SQL Server table really matter? E.g. Is CREATE NONCLUSTERED INDEX [MultiFieldIndex_1] ON [Table_01] ([Column_A],[Column_B],[Column_C],[Column_D]) same as CREATE NONCLUSTERED INDEX [MultiFieldIndex_1] ON [Table_01] ([Column_D],[Column_C],[Column_B],[Column_A]) ?...

Optimize the execution of select

I want optimize this select: Select Dane1, Dane5, Dane6, Dane7 FROM Test INNER JOIN Test2 ON Test.Id=Test2.IdTest WHERE Dane5 > 199850 My database has 2 tables test, test2: test design: Id int ->PRIMARY KEY, Dane1 int, Dane2 int, Dane3 int, Dane4 int, Dane5 int, test2 design: Id int ->PRIMARY KEY,...