+ Reply to Thread
Results 1 to 2 of 2

Thread: Sql index

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    34

    Sql index

    I want to create an index for my table to increase performance
    This is my SQL-Code :
    Code:
    Create table WebPages(
    PageID int not null,
    PageUrl varchar(1000),
    Checksum Code bigint
    )
    This is the query I want to index
    Code:
    select PageID from WebPages where UrlChecksumCode = @UrlChecksumCode and PageUrl = @PageUrl

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    40
    Since the url is more than 1000 and the index can only hold up to 900 bytes , you must use include column .
    You can use that Query :
    Code:
    create index IDXName on WebPages (UrlChecksumCode) INCLUDE(PageUrl, PageID)

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts