Skip to content

Remove mostly unused keywords column from crates table #270

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

Merged
merged 1 commit into from
Feb 20, 2016

Conversation

sgrif
Copy link
Contributor

@sgrif sgrif commented Feb 19, 2016

This column was present both in the table and in the Rust model, but
was only ever used to update the search index on update. The actual
source of keyword info is the crates_keywords table, and it's actually
reasonably easy for this column to get out of sync.

Instead of relying on things calling the update_crate function every
time the keywords column is modified, we can instead populate the column
with a subselect which grabs the keywords associated. This also means we
need an additional trigger to touch the crate whenever the
crates_keywords table is modified.

This column was present both in the table and in the Rust model, but
was only ever used to update the search index on update. The actual
source of keyword info is the crates_keywords table, and it's actually
reasonably easy for this column to get out of sync.

Instead of relying on things calling the `update_crate` function every
time the keywords column is modified, we can instead populate the column
with a subselect which grabs the keywords associated. This also means we
need an additional trigger to touch the crate whenever the
crates_keywords table is modified.
@alexcrichton
Copy link
Member

Oh man, I have so much sql-fu I need to learn. Thanks!

alexcrichton added a commit that referenced this pull request Feb 20, 2016
Remove mostly unused keywords column from crates table
@alexcrichton alexcrichton merged commit 119e80b into rust-lang:master Feb 20, 2016
@Turbo87 Turbo87 mentioned this pull request Feb 23, 2016
@sgrif sgrif deleted the sg-remove-keywords-column branch March 6, 2017 18:12
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