What generic techniques can be applied to optimize SQL queries?

后端 未结 11 1716
礼貌的吻别
礼貌的吻别 2020-12-13 21:28

What techniques can be applied effectively to improve the performance of SQL queries? Are there any general rules that apply?

11条回答
  •  离开以前
    2020-12-13 22:24

    Make sure that you have the right indexes on the table. if you frequently use a column as a way to order or limit your dataset an index can make a big difference. I saw in a recent article that select distinct can really slow down a query, especially if you have no index.

提交回复
热议问题