简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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