简体   繁体   English

学说1.2表现

[英]Doctrine 1.2 performance

How to speed up Doctrine in routine statements like getting collection or related data from object? 如何在常规语句中加速Doctrine,比如从对象获取集合或相关数据?

What's better if i want to get list with related tables data. 如果我想获得具有相关表格数据的列表,那会更好。 Native sql in doctrine or using doctrine_query? doctrine中的本机sql还是使用doctrine_query?

Several things could help. 有几件事可以帮上忙。 I've noticed substantially better performance with Doctrine 2. 我注意到Doctrine 2的表现要好得多。

Working with Doctrine 1.2 one of the best things you can do is hydrate to as simple of a structure as you can. 使用Doctrine 1.2,您可以做的最好的事情之一是尽可能简单的水合物。 I had reports that I could definitely not hydrate to record on but worked find if I hydrated to scalar or array. 我曾经有报道说我绝对不能保持记录,但是如果我能够保持标量或阵列,我就会找到它。

Other than that, make sure you use DQL instead of the magic finders to load objects. 除此之外,请确保使用DQL而不是魔术探测器来加载对象。 Using DQL will help ensure you load all parts of your object graph that you need in one query (see lazy loading). 使用DQL将有助于确保在一个查询中加载对象图的所有部分(请参阅延迟加载)。

Hope some of this helps. 希望有些帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM