-
-
Notifications
You must be signed in to change notification settings - Fork 625
feat: added identities GIN index on users #7805
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
base: master
Are you sure you want to change the base?
feat: added identities GIN index on users #7805
Conversation
COMPARE TO
|
Name | Diff |
---|---|
packages/schemas/alterations/next-1757660909-add-identities-index.ts | 📈 +428 Bytes |
packages/schemas/tables/users.sql | 📈 +74 Bytes |
My fault this time, I named the file as |
I'm sorry but I can't understand what's going on
That is not able to retrieve the branch Probably I'm missing something, but I can't understand what is it |
Hi, @SamSalvatico thanks for your contribution. The PR itself looks straightforward to me. However, I’m not sure about the effectiveness of creating a GIN index on the entire In the |
You need to bump the timestamp in the alteration script file you added. Since other alteration scripts have already been merged into master, the CI job compares the head with the master branch to determine which scripts to run. The timestamp in this PR may be outdated and could be rejected. |
I did update the timestamp and it was the latest in the list, before the merge, but was still failing. Anyway, we introduced that index in our fork, but we noticed it wasn't hit as expected. Given that we had no luck with different indexes, we tried another approach.
But we noticed that the identities column, on the db, is declared as JSONB, so it is forcing the casting to the JSON type at runtime, with no specific needs. We tried removing that cast both in What do you think? Would be an idea to "fix" that query before moving on with the indexes? Or is there a reason for the |
Thanks for sharing — that’s a very good point. Since this query is quite old, I might not have enough context at the moment, l et me check with the team and get back to you shortly. By the way, regarding the failing CI job, I suspect it may be related to repository access rules. Once we’ve agreed on the code updates, I’ll take a closer look. Thanks again. |
Summary
Please note: I am opening this PR replacing the #7718 to ensure that all commits are signed
As discussed through the Discord channel, I've added a GIN index on the
identities
column of the users table to speed up this queryThat starts slowing down while users are incrementing
Testing
Tested locally running tests and manually invoking APIs
Checklist
.changeset