Workspaces - I have a component in a workspace that allows filtering customers. Based on the search results the customer details are displayed in the section below
The query performed to the database to display the details of the customer found does a LEFT JOIN with all the customer associations, regardless if those associations are needed to display the customer details or not (in the screenshot, the address is the single association that is required but we have more that we don’t need for this component)
We keep receiving slow query alerts in our error tracking system because these queries are causing performance issues on our database as they are doing a lot of unnecessary costly joins.
On the normal list/details views for the customer I don’t observe this behaviour.
Expected behavior
The query performed to the database to retrieve the customer details should only use LEFT JOINS for the associations that are being displayed in the customer details component.
Context
Project name: Back Office
Team name: Customer Operations
Workspace: Customer Success Workspace
Environment name: can be reproduced in all environments but production is the one severely affected by
Database type: Postgresql
And, if you are self-hosting your agent:
Agent technology: Ruby
Agent (forest package) name & version (from your .lock file): 9.11.3
Hi @sergior,
on our oldest agent all the belongs to were fetched.
You will need to migrate to our new agent forest_admin_rails, you can find the documentation here: Quick start | Ruby Developer Guide
By the way, I noticed you’re currently on version 9.11.3, before migrating to the new agent, you could try bumping to the latest 9.14.5, which includes several fixes that could help improve query performance.
There are no breaking changes between these patch versions, so it should be a safe update.