Changeset 3554
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/manual/docs/en/improving-performance/fetch-only-what-you-need.txt
r1796 r3554 51 51 } 52 52 </code> **Array fetching is the best choice whenever you need data read-only like passing it to the view for display. And from my experience, most of the time when you fetch a large amount of data it's only for display purposes. And these are exactly the cases where you get the best performance payoff when fetching arrays instead of objects.** 53 54 Sometimes, you may want the direct output from PDO instead of an object or an array. To do this, set the hydration mode to **Doctrine::HYDRATE_NONE**. Here's an example: 55 <code type="php"> 56 $total = Doctrine_Query::create() 57 ->select('SUM(d.amount)') 58 ->from('Donation d') 59 ->execute(array(), Doctrine::HYDRATE_NONE); 60 </code> -
branches/0.9/manual/docs/en/improving-performance/fetch-only-what-you-need.txt
r1796 r3554 51 51 } 52 52 </code> **Array fetching is the best choice whenever you need data read-only like passing it to the view for display. And from my experience, most of the time when you fetch a large amount of data it's only for display purposes. And these are exactly the cases where you get the best performance payoff when fetching arrays instead of objects.** 53 54 Sometimes, you may want the direct output from PDO instead of an object or an array. To do this, set the hydration mode to **Doctrine::HYDRATE_NONE**. Here's an example: 55 <code type="php"> 56 $total = Doctrine_Query::create() 57 ->select('SUM(d.amount)') 58 ->from('Donation d') 59 ->execute(array(), Doctrine::HYDRATE_NONE); 60 </code>