Created
September 3, 2017 12:06
-
-
Save BrentOzar/b4d6a6776d47084d71f467db1eb4ac10 to your computer and use it in GitHub Desktop.
Creating basic indexes on the public Stack Overflow database export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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