创建优化的Azure SQL表进行查询 [英] Creating optimized Azure SQL table for querying

查看:70
本文介绍了创建优化的Azure SQL表进行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在Azure SQL DB中有一个具有一百万行的表.使用WHERE子句可以优化表以执行查询的方式有哪些.第1列用于作为主键的id.第2到5列是地址(圣,城市,州,邮政编码),第6到8列是数字.

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.

推荐答案

查看索引.如果要按地址搜索,请在地址字段上添加索引.如果大多数搜索都是通过邮政编码进行的,请在该字段上添加索引.有关索引的更多信息,请参阅此文档索引表

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

这篇关于创建优化的Azure SQL表进行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆