开发者_运维问答I have a symfony admin generator page where each row makes several function calls and, therefore, several trips to the database.
I added a query to table_method
and used some joins but it doesn't reduce the number of queries executed on my page.
What's a person supposed to do to improve performance here?
your query linked to your "table_method" must have all the fields that show otherwise you're probably ignoring some kisa field or your query did not add in fields related to samples
Symfony according to the manual that is done to reduce the number of queries as follows:
# apps/backend/modules/job/config/generator.yml
config:
list:
table_method: retrieveBackendJobList
// lib/model/doctrine/JobeetJobTable.class.php
class JobeetJobTable extends Doctrine_Table
{
public function retrieveBackendJobList(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.JobeetCategory c');
return $q;
}
// ...
You can disable some filters on foreign key, they have their own specifics requests, not based on table_method.
精彩评论