Lazy vs. eager loading of fields.
字段的惰性与积极加载。
Lazy (Deferred) and Eager loading.
懒惰(延迟)和预先加载。
Fortunately, you can fix this by using eager loading.
幸好,通过使用立即加载,我们可以修复这个问题。
Eager loading returns all related objects together with the queried objects in a single query.
预先加载将所有相关对象和所查询的对象在单个查询中一起返回。
Eager loading across complex models is complex, usually requiring SQL when many rows must be joined.
跨越复杂模型进行预先加载很复杂,通常在连接多行时需要使用SQL。
You can use the eager loading technique whenever you know that you will use relationships in a given query.
一旦要在给定的查询中使用关系,就可以采用热加载技术。
Eager loading means that Rails will automatically perform the necessary queries to load the object of any specified child objects.
立即加载意味着Rails将自动执行所需的查询来加载任何特定子对象的对象。
This script tests the speed of looping over 100, 1,000, and 10,000 objects with and without eager loading using the: include clause.
这个脚本使用:include子句测试在有和没有立即加载的情况下对100、1,000和10,000个对象进行循环操作的速度如何。
Of course, the exact outcome depends on your particular situation, but eager loading can clearly lead to significant performance gains.
当然,具体的输出取决于您的特定情况,但立即加载可明显导致显著的性能改善。
This class is not for public use and is used internally by the system to implement support for queries with eager loading of related entities.
此类不以公共方式使用,而是由系统在内部使用,用于实现对预先加载相关实体的查询的支持。
Even Better prefetch Paths: We made the prefetch path engine (eager loading) even smarter so it now knows more ways to optimize the queries it has to create.
更加优秀预取路径:我们设计了预取路径引擎(提前加载)更加智能以至于能通过更多的方法来优化它创建的查询。
Eager loading One way to improve performance is to cut down. The number of SQL queries. You can do this through eager loading. Learn all about it in this episode!
提高性能的一个途径就是减少SQL查询的次数,可以通过贪婪加载来实现。这一节就来讲述相关内容。
Keeping up with your indexes, using eager loading with include, and using polymorphic associations in places instead of inheritance are just three ways you can use to improve your code base.
保留索引、借助include使用热加载和在某些地方使用多态关联代替继承是三种可用来改进代码库的方法。
Strive for the right balance between eager and lazy loading strategies.
争取在eager和lazy装载策略之间找到恰当的平衡点。
If you choose to return the POJO from the facade, you will either need to set the loading to "eager" or to touch all the fields in the JPA entity.
如果您选择从Facade返回POJO,则需要将加载设置为“eager”或者改动jpa实体中的所有字段。
If you choose to return the POJO from the facade, you will either need to set the loading to "eager" or to touch all the fields in the JPA entity.
如果您选择从Facade返回POJO,则需要将加载设置为“eager”或者改动jpa实体中的所有字段。
应用推荐