对于执行缓慢的查询,您最酷的 SQL 优化是什么? [英] What was your coolest SQL optimization, on a slow performing query?

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

问题描述

刚刚和我的一位同事说话.在去咖啡机的路上,他步履蹒跚.

Just speaking to a colleague of mine. He was walking with a hop in his step, on the way to the coffee machine.

我问他'swarmy'walk 是怎么回事?",他说,我只是将两个小时的查询时间缩短到 40 秒!感觉真好.

I asked him "what's with the 'swarmy' walk?", he said, "I just reduced a two hour long query down to 40 seconds! It feels so good".

他修改了一个使用游标的存储过程,并引入了一个临时表,该表是从原始数据集重构而来的 - 我很快就会给他发电子邮件,以获取有关实际实现的更多信息.

He altered a stored procedure, that was using cursors and introduced a temp table, that was refactored from the original dataset - I will email him soon, to get more info on actual implemetation.

但最终,他很兴奋.

问题是,什么样的 SQL 会在您的脑海中萦绕不去,并让您大呼过瘾,同时优化了执行缓慢的查询?

Question is, what SQL, that sticks in your mind and has made you buzz, whilst optimising slow performing queries?

推荐答案

我不得不说我什么时候学会了如何创建和使用覆盖索引.现在,是一个性能助推器.

I have to say when I learned how to create and use covered indexes. Now, THAT was a performance booster.

这篇关于对于执行缓慢的查询,您最酷的 SQL 优化是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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