Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Creating basic indexes on the public Stack Overflow database export
CREATE INDEX IX_UserId ON dbo.Badges(UserId);
GO
CREATE INDEX IX_PostId ON dbo.Comments(PostId);
GO
CREATE INDEX IX_UserId ON dbo.Comments(UserId);
GO
CREATE INDEX IX_PostId ON dbo.PostLinks(PostId);
GO
CREATE INDEX IX_RelatedPostId ON dbo.PostLinks(RelatedPostId);
GO
CREATE INDEX IX_LinkTypeId ON dbo.PostLinks(LinkTypeId);
GO
CREATE INDEX IX_AcceptedAnswerId ON dbo.Posts(AcceptedAnswerId);
GO
CREATE INDEX IX_LastEditorUserId ON dbo.Posts(LastEditorUserId);
GO
CREATE INDEX IX_OwnerUserId ON dbo.Posts(OwnerUserId);
GO
CREATE INDEX IX_ParentId ON dbo.Posts(ParentId);
GO
CREATE INDEX IX_PostTypeId ON dbo.Posts(PostTypeId);
GO
CREATE INDEX IX_PostId ON dbo.Votes(PostId);
GO
CREATE INDEX IX_UserId ON dbo.Votes(UserId);
GO
CREATE INDEX IX_VoteTypeId ON dbo.Votes(VoteTypeId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment