在VBA中优化查询的最佳工具是什么?为什么? [英] What are the best tools for optimizing queries in VBA and why?

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

问题描述

我对编程还很陌生,我想知道.时间和优化代码的最佳方法是什么?我当前想要计时的代码是VBA中针对MS-Access的一系列查询,但是我也想在VB.NET和ASP.NET中计时代码.

I'm fairly new to programming and I was wondering; What are the best ways to time and optimize my code? The code I'm currently wanting to time is a series of queries in VBA for MS-Access, but I would also like to time code in VB.NET and ASP.NET as well.

因此,重申一下,为每种语言计时代码并对其进行优化的最佳方法是什么?

So to reiterate, what is the best way to time code and optimize it for each language?

请提供原因和解释,以帮助我了解如何进行操作.

Please give reasons and explanations to help me understand how to do it.

先谢谢了.

推荐答案

此计时器可能会有所帮助: http: //support.microsoft.com/kb/233275

This timer may help: http://support.microsoft.com/kb/233275

利用索引(可查询)的查询将运行得更快.还有其他要点,例如,如果不需要的话,避免使用Order By.通常,最好发布似乎耗时太长的SQL,您通常会获得许多提高速度的建议.

A query that takes advantage of indexes (sargable) will run faster. There are other points, such as avoiding Order By, if it is not necessary. Generally it is best to post SQL that seems to take too long and you will often get a number of suggestions for improving the speed.

这篇关于在VBA中优化查询的最佳工具是什么?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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