如何加快数据库的速度? [英] How do I speed up my database?

查看:59
本文介绍了如何加快数据库的速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有两个子表单的表单。现在,主要形式打开得非常慢。我相信原因是两个子表格。我的问题是,加载所有记录而不过滤它们是否更快,或者使用查询来过滤记录,以便只有活动记录。记录显示?现在,子表单基于没有WHERE子句的查询。在每个表中,有一个填充在最后的字段,如果填充,则意味着用户不再需要处理该记录。我可以测试一下该字段是否为null = true。我只是不知道这是否增加或减少了数据库的负载。

解决方案

这取决于,如果它是一个未优化的过滤器,过滤可以减慢但是可以如果优化,加快速度。在这种情况下,它可能会加速它。确切知道的唯一方法是测试它。


我想我可以测试一下。唯一的问题是现在我只有测试信息,而不是很多,所以可能很难区分。


什么是优化/未优化的过滤器?

嗯,这是一个更优化的规模。


匹配精确值比匹配部分值更快。

对数字的过滤比字符串更快。

In比没有更快。

索引比未编入索引更快。

完全覆盖index比部分索引快。

等等。


有很多因素会影响过滤器的速度。在你的情况下,你只是过滤了一个确切的值,所以我不希望这花费太长时间。


但是,这可能都没有实际意义。你说它只是测试数据而不是很多。我怀疑那不是记录的数量减慢了子窗体的加载速度。它可能是由其他东西引起的。


I have a form that has two subforms. Right now, the main form opens very slowly. I believe the reason is the two subforms. My question is, is it faster to load all records without filtering them, or to use a query to filter down records so that only "Active" records are shown? Right now, the subforms are based on queries that have no WHERE clause. In each of the tables, there is a field that is filled in last which if populated, would mean that the user won''t need to handle that record anymore. I could test to see if that field is null = true. I just don''t know if this increases or decreases the load on the database.

解决方案

It depends, filtering can slow down if it is an unoptimized filter but can speed it up if optimized. In this situation, it would probably speed it up. The only way to know for sure is to test it.


I guess I could test it. The only problem is right now I only have test information and not a lot of that so it may be hard to tell the difference.

What is an optimized/unoptimized filter?


Well, it''s more a scale of optimization.

Matching an exact value is quicker than matching a partial value.
Filtering on numbers is quicker than strings.
In is quicker than not in.
Indexed is faster than not indexed.
Fully covered index is faster than partial index.
Et cetera.

There''s a lot of factors that affect the speed of a filter. In your case, you''re just filtering on an exact value so I don''t expect that to take too long.

However, this may all be moot. You said it''s just test data and not a lot at that. I suspect then that it is not the amount of records that''s slowing down the loading of the subform. It''s likely to be caused by something else.


这篇关于如何加快数据库的速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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