New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): load face entities faster #5281
Conversation
server/src/infra/migrations/1700747853368-AddAssetFaceIndicies.ts
Outdated
Show resolved
Hide resolved
These indexes should be managed inside the typeorm schema. Take a look at the following docs from TypeORM, you can create the indexes using the schema and have it automatically generate the migration file for you. https://orkhan.gitbook.io/typeorm/docs/indices |
94142c6
to
4fb2fed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Is there a way to have postgres show the slowest x queries? It would be cool to see what those are on a large instance.
The query executed when loading the "People" page joins, among others, over "personId". The added indices improve the overall performance of those JOIN queries. Additionally, one ORDER BY clause is dropped since the resulting values will always be TRUE, and thus, sorting them does not change the result.
4fb2fed
to
d10aecc
Compare
@jrasm91 there are many ways to monitor your PostgreSQL instance. You could use, e.g., the pg_stat_statements extension. |
For development and testing, you can use pg_stat_statements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
The added indices are based on monitoring a server with
Especially the query executed when loading the peoples' page gains a speedup of 4x.