Sql-server – Optimal table with N:1 foreign key column

foreign keyindexsql server

I have an MS SQL table like this:

TABLE myLog(
  [LogID] [int] IDENTITY(1,1) NOT NULL,
  [ThingID] [int] NOT NULL,
  [Action] [varchar](100) NOT NULL,
CONSTRAINT [PK_myLog] PRIMARY KEY CLUSTERED 
(
  [LogID] ASC
)

ThingID is a foreign key for a myThings table identity column.

myLog can contain many rows for any ThingID.

What are the best ways to index or key myLog given that a typical query will request all rows for a particular ThingID?

Best Answer

I would just put a non-clustered index on ThingID. A and declare the relationship.