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

typo in deleting blob archive data #16717

Merged
merged 7 commits into from Nov 16, 2020
Merged

typo in deleting blob archive data #16717

merged 7 commits into from Nov 16, 2020

Conversation

diosmosis
Copy link
Member

Description:

archive tables are determined by start date, but we're using end date in this one place (probably due to autocomplete error)

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Nov 15, 2020
@diosmosis diosmosis added this to the 4.0.0-RC milestone Nov 15, 2020
@tsteur
Copy link
Member

tsteur commented Nov 15, 2020

LGTM @diosmosis I suppose you add the DB upgrade statement here?

@diosmosis
Copy link
Member Author

@tsteur added the new update

{
$migrations = [];

$dates = ['2020-01-01', '2020-10-01', '2020-09-01'];
Copy link
Member

Choose a reason for hiding this comment

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

@diosmosis does it need november in there too? I reckon we could actually remove September but no preference. We only released the beta on like 29th of September so it wouldn't have been much of an issue back then

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yes, it should, will fix

Copy link
Member Author

Choose a reason for hiding this comment

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

@tsteur updated

$blobTable = ArchiveTableCreator::getNumericTable($date);

$migrations[] = $this->migration->db->sql("DELETE FROM `$blobTable` WHERE idarchive NOT IN (
SELECT idarchive FROM `$numericTable`)");
Copy link
Member

Choose a reason for hiding this comment

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

probably won't make a difference but might be better to use SELECT DISTINCT in the subquery? I reckon this might speed up the deletion since it will need to check a lot less entries for each row whether id is included

@tsteur tsteur merged commit 247eb77 into 4.x-dev Nov 16, 2020
@tsteur tsteur deleted the blob-deletion-typo branch November 16, 2020 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants