开发者

Doctrine 1.2 performance

How to speed up Doctrine in routine statements like getting collection or related data from object?

What's better if i want to get list with related 开发者_高级运维tables data. Native sql in doctrine or using doctrine_query?


Several things could help. I've noticed substantially better performance with 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. 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. Using DQL will help ensure you load all parts of your object graph that you need in one query (see lazy loading).

Hope some of this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜