您最常用的sql优化是什么? [英] What are your most common sql optimizations?

查看:63
本文介绍了您最常用的sql优化是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您使用的最常见的SQL优化是什么?

What are your most common SQL optimization that you used?

推荐答案

通过仅返回所需的字段并仅返回所需的行来减少返回的数据量.这是最常见的情况,因为您需要为每个返回数据的查询执行此操作.

Reducing the amount of data that is returned, by only returning the fields required and only returning the rows required. This is the most common, as you do it for every query that returns data.

添加索引.这样做的频率不高,因为某些表除了为主键创建的索引外不需要任何其他索引.

Adding indexes. This is not done as frequently, as some tables doesn't need any other index than the one created for the primary key.

这篇关于您最常用的sql优化是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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