Looking at the database
Our web site connects to the database, executes a query, and then returns the result set. We can start looking at how we can improve its performance here. Some of the things that we can do are create custom queries and, possibly, replace the ORM layer.
Setting limits and columns in the criteria
Propel is very powerful when it comes to building a relatively complex SQL criteria. But the default criteria assumes that all columns are required if you do not explicitly specify them. To do this, you can use the addSelectColumn() method:
clearSelectColumns(); PropelaboutaddSelectColumn(self::COLUMN_NAME);
Also, you can set a limit when you need only one result:
setLimit($limit);
For further documentation on the criteria class, refer to the Propel documentation at http://propel.phpdb.org/docs/api/1.3/runtime/propel-util/ Criteria.html.
Creating your own SQL statements
As you have seen while using Propel, it is very simple to create a criteria and pass it to Propel, which then...