Skip to content
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(store): added postgres index for owner columns #7625

Merged
merged 2 commits into from Aug 31, 2023

Conversation

lukidzi
Copy link
Contributor

@lukidzi lukidzi commented Aug 31, 2023

Checklist prior to review

When removing Mesh we are removing all resources in cascade. We have a foreign_key which uses owner_type, owner_mesh, owner_name. When mesh is removed all the resources are removed in a cascade mode. The issue is that when cascade remove is triggered we are iterating over the table without indexing. Fields referenced by the foreign_key are not indexed that why the operation is slow.

  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label) --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
@lukidzi lukidzi requested a review from a team as a code owner August 31, 2023 09:42
@lukidzi lukidzi requested review from slonka and jakubdyszkiewicz and removed request for a team August 31, 2023 09:42
Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
@bartsmykla
Copy link
Contributor

Just to demonstrate the improvement.
Was before:
image
Is now:
image

@lukidzi lukidzi merged commit 7fe0502 into kumahq:master Aug 31, 2023
6 checks passed
@lahabana lahabana changed the title feat(kuma-cp): added index for owner columns feat(postgres): added index for owner columns Nov 3, 2023
@lahabana lahabana changed the title feat(postgres): added index for owner columns feat(store): added postgres index for owner columns Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants