recordfinder query extend #761
Unanswered
SledgehammerPL
asked this question in
Q&A
Replies: 2 comments 8 replies
-
Just to first check, have you got indexes added on related columns, like the Also, which database server are you using? |
Beta Was this translation helpful? Give feedback.
6 replies
-
model/person/fields.yaml
can I use the scope in fields.yaml? What about parameter? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got big fundamental problem.
My model is a little bit complex:
And of course Person Model has hasMany set,
and PersonName Model:
public $belongsTo = [
'person' => ['Party\Structure\Models\Person']
];
And now - I set models/person/columns.yaml:
But showing the columns takes 70 seconds .... The same if I set it in record finder. And I don't know how to set filter, because this below, doesn't work
If I use (in Controller)
and other columns.yaml:
Columns appears in 3 seconds and filter works perfectly. BUT. Record Finder doesn't work at all...
What can I do? I need record finder, but not for the price of 70 seconds for list and every changing sorting or searching
this is sql which takes 73,379.131 ms.
``select "party_structure_people".*, (select string_agg(first_name::VARCHAR, ', ') from "party_structure_person_names" where "party_structure_people"."id" = "party_structure_person_names"."person_id") as "first_name", (select string_agg(last_name::VARCHAR, ', ') from "party_structure_person_names" where "party_structure_people"."id" = "party_structure_person_names"."person_id") as "last_name" from "party_structure_people" order by "first_name" asc limit 20 offset 0`
And my sql which I works in 97.214 ms:
select "party_structure_people".*, party_structure_person_names.first_name, party_structure_person_names.last_name from "party_structure_people" LEFT JOIN "party_structure_person_names" ON "party_structure_people"."id"= "party_structure_person_names"."person_id" order by "first_name" asc limit 20 offset 0
`
Beta Was this translation helpful? Give feedback.
All reactions