Skip to content

Meta cache breakdown #167

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 6 commits into from
Aug 5, 2020
Merged

Conversation

melange396
Copy link
Collaborator

1 SQL query per distinct (src, sig) instead of 1 global

…pdates.

Also fixed/improved setUp in integrations/server/test_covidcast_meta.py and added skeleton-code for new `missing_*` rows.
tests changed as i pulled the serialization down a layer
@melange396
Copy link
Collaborator Author

so in sum total, the applying this change to the db would either require wiping/recreating/repopulating from scratch, or applying this SQL:

ALTER TABLE `covidcast` RENAME COLUMN `timestamp1` to `value_updated_timestamp`;
ALTER TABLE `covidcast` RENAME COLUMN `timestamp2` to `direction_updated_timestamp`;

ALTER TABLE `covidcast` ADD `is_wip` BINARY(1) DEFAULT (NULL);

-- and then either these (should be faster)
UPDATE TABLE `covidcast` SET `is_wip` = 1 WHERE `signal` LIKE 'wip_%';
UPDATE TABLE `covidcast` SET `is_wip` = 0 WHERE `is_wip` IS NULL;

-- or these (at least slightly safer)
UPDATE TABLE `covidcast` SET `is_wip` = 0 WHERE `is_wip` IS NULL and `signal` NOT LIKE 'wip_%';
UPDATE TABLE `covidcast` SET `is_wip` = 1 WHERE `is_wip` IS NULL and `signal` LIKE 'wip_%';

@korlaxxalrok
Copy link
Contributor

@melange396 The necessary changes should be done.

@AlSaeed
Copy link
Contributor

AlSaeed commented Aug 5, 2020

Merge Conflict Resolution PR:
melange396#1

Copy link
Contributor

@AlSaeed AlSaeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@krivard krivard merged commit e24d5f1 into cmu-delphi:staging Aug 5, 2020
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.

4 participants