How to Write Optimal SQL Queries

后端 未结 9 1500
余生分开走
余生分开走 2021-02-01 06:47

I\'ve searched around stackoverflow but everybody asks to optimize queries they\'ve already done.

I want to know, the basic stuff on what to do, what to avoid when creat

9条回答
  •  梦毁少年i
    2021-02-01 07:39

    I cant actually validate your claim but can say that not using * sounds quiet logical, what i can do is add a point or two to them, if you can along with giving a select columnname from tablename add a where clause it helps a lot, since you would cut down on a lot of unnecessary rows and rows of data that may be pulled up, also avoiding cross joins and welcoming inner joins, outer joins or fuller joins should be the way to go as per my personal experience :)

提交回复
热议问题