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

Add tootctl statuses remove to sweep unreferenced statuses #10063

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Feb 16, 2019

Query by @tateisu

Fix #1554

For discussion:

  • Name of command
  • Interface of command, e.g. options
  • Verbosity of command
  • The query itself

@nightpool
Copy link
Member

needs to handle statuses fetched by threadresolveworker (i.e. root statuses with replies from remote followed accounts).

@tateisu
Copy link
Contributor

tateisu commented Feb 17, 2019

even it does not have reply id,it will not deleted.
because it will contains mention to local user.
also toots from remote followed user.

@nightpool
Copy link
Member

user A (not followed by anybody) posts
user B replies to A (followed by local user C)

user A's status is fetched by thread resolve worker, but not excluded from this query.

@tateisu
Copy link
Contributor

tateisu commented Feb 17, 2019

.where('id NOT IN (SELECT statuses1.in_reply_to_id FROM statuses AS statuses1 WHERE statuses.id = statuses1.in_reply_to_id)') is excludes all statuses that have replies.

@tateisu
Copy link
Contributor

tateisu commented Feb 17, 2019

https://gist.github.com/tateisu/c3c13f2580961e86f79889a17f57260a original post about this query

@Gargron Gargron marked this pull request as ready for review February 18, 2019 14:00
@Gargron Gargron merged commit 6766502 into master Mar 11, 2019
@Gargron Gargron deleted the feature-tootctl-statuses-remove branch March 11, 2019 12:45
@BenLubar
Copy link
Contributor

A description more precise than Remove statuses might make more admins run it. I only learned what this actually does because I was curious, and I wouldn't have ever run it if I didn't see the query.

hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
@jelutz77
Copy link

Just ran this command, and it removed 10GB of about 70GB of data. I have 2 active users on my instance and it's only been running about a month. I spend entire days without interacting, and so does the other user. It seems to me that the command should free up MUCH more space than this?

messenjahofchrist pushed a commit to Origin-Creative/mastodon that referenced this pull request Jul 30, 2021
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.

Sweep up old federated toots from local DB
6 participants