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

Set work_memfor annotation/label migration #3632

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Set work_memfor annotation/label migration #3632

merged 1 commit into from
Feb 9, 2024

Conversation

johha
Copy link
Contributor

@johha johha commented Feb 8, 2024

Migration 20240102150000_add_annotation_label_uniqueness.rb contains the delete statements, similar to:

DELETE FROM "service_instance_annotations" WHERE ("id" NOT IN (SELECT "min_id" FROM "service_instance_annotations_temp"));

Depending on the work_mem setting in postgres this statement can become very expensive (e.g. cost of 1608032037) due to a materialized subplan. Increasing the work_mem to 64MB allows postgres to use a sequential scan.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Migration `20240102150000_add_annotation_label_uniqueness.rb` contains
the delete statements, similar to:
```
DELETE FROM "service_instance_annotations" WHERE ("id" NOT IN (SELECT "min_id" FROM "service_instance_annotations_temp"));
```

Depending on the `work_mem` setting in postgres this statement can become very expensive (e.g. cost of 1608032037) due to a materialized subplan.
Increasing the `work_mem` to 64MB allows postgres to use a sequential scan.
@johha johha merged commit 947e469 into main Feb 9, 2024
14 checks passed
@johha johha deleted the work-mem branch February 9, 2024 09:15
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.

2 participants