Creating optimized Azure SQL table for querying

2019-08-28 11:07发布

问题:

Assuming I have a table in Azure SQL DB with a million rows. What are the ways I can optimize the table for performing queries using WHERE clause. Column 1 is for the id which is the primary key. Column 2 to 5 is for addresses (St, city, state, zip) and columns 6 to 8 are digits.

回答1:

Look into indexes. If you are going to search by address, add an index on address fields. If most searches are by zip code, add an index on that field. For more info on indexes have a look at this document Index Table