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
Stream Wrapper: Tweaks to vip files update-filesizes
script
#1173
Conversation
That way we store the filesize and avoid future lookups.
Just to be sure :)
Script won't work without it.
Much faster than really large LIMITs especially when using an index.
vip files update-filesizes
script
End the loop only after we've finished going through all IDs. Also kills the progress bar which isn't great for seeing ongoing progress on really large sites.
|
||
$max_id = $wpdb->get_var( 'SELECT ID FROM ' . $wpdb->posts . ' ORDER BY ID DESC LIMIT 1' ); | ||
|
||
$end_index = $start_index + $batch_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we at all concerned about how accurate the $end_index
would be? It is very likely that the post ID will not be sequential
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the way it's written, we just loop through all post IDs until we hit the highest one. We will probably have batches where there are 0 results or 0 attachments but that's okay.
r133803-deploy |
A couple of optimizations and improvements:
And a few other small changes.
Checklist
Please make sure the items below have been covered before requesting a review: