ziycon

  • Posts: 126
Post Deletion
« on May 2nd, 2013, 01:16 AM »
Just got thinking there (inspired by some recent conversations), can the way way post deletion works be changed, this is mainly to keep continuity of topics/conversations.

For example say there is 20 posts in a topic and the 5th post is questionable and there are 3 posts after it that reply directly to the questionable content and bring the topic off the original topic. You go and 'delete' (flag change on the post in the database) the 4 questionable posts but what actually happens that they can still be seen in the context of the topic by only mods & admins for continuity reasons and a comment can be added by whoever 'deleted' the posts so other mods & admins can see why they were deleted.

Then there is then a page (bin) or whatever you want to call it, were you can purge 'deleted' posts and this purge will permanently delete the selected posts from the database?
Re: Post Deletion
« Reply #1, on May 2nd, 2013, 01:28 AM »
Off course if this is already a feature then ignore this request, as I can't see to test it ;)
APRAI - Custom Theme - SMF 2.0.5


Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post Deletion
« Reply #2, on May 2nd, 2013, 02:02 AM »
You know a recycle bin was a feature in SMF for *years* right?

We haven't removed it though the plan is to do so and essentially have 'soft deleted' posts still inline but not visible to regular users, while hard deleted posts would be gone entirely.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

ziycon

  • Posts: 126
Re: Post Deletion
« Reply #3, on May 2nd, 2013, 08:54 AM »
Ye, I know about the recycle bin just putting it in context for my post.

Good to hear you were already thinking around the soft/hard delete and keeping soft deleted posts inline.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Post Deletion
« Reply #4, on May 2nd, 2013, 12:29 PM »
This technique has been used on Noisen.com for about 6 years, the only reason it isn't in Wedge yet is that Pete is concerned with performance issues on larger boards. (Also, we need to determine that if soft deletion is enabled, then 'post moderation' mode is also active, as for now it only becomes active if a moderation filter has been set.)

ziycon

  • Posts: 126
Re: Post Deletion
« Reply #5, on May 2nd, 2013, 12:36 PM »
The performance downsides should only affect mods and admins as normal users will not see the soft deleted posts.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post Deletion
« Reply #6, on May 2nd, 2013, 12:46 PM »
Incorrect. It works exactly the opposite way around.

If mods and admins see everything, there's no need to filter out the messages they can't see. No extra work required.

But if you have to select items, you have to prefetch and strip out the rows you don't want - and you can't use an index for it due to low selectivity (a topic with 1000 posts and a moderated reply at the end has 1001 rows of which you want 1000, and the system will have to go through every row for that because the index will be no good for that use case)

ziycon

  • Posts: 126
Re: Post Deletion
« Reply #7, on May 2nd, 2013, 01:14 PM »
Quote from Arantor on May 2nd, 2013, 12:46 PM
Incorrect. It works exactly the opposite way around.

If mods and admins see everything, there's no need to filter out the messages they can't see. No extra work required.

But if you have to select items, you have to prefetch and strip out the rows you don't want - and you can't use an index for it due to low selectivity (a topic with 1000 posts and a moderated reply at the end has 1001 rows of which you want 1000, and the system will have to go through every row for that because the index will be no good for that use case)
Is this the case if you had a flag on the posts so in the query your searching for all posts for this topic AND that are 'active', this way there is no filtering of posts, your only returning what will be displayed!?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post Deletion
« Reply #8, on May 2nd, 2013, 01:20 PM »Last edited on May 2nd, 2013, 01:26 PM
Quote
Is this the case if you had a flag on the posts so in the query your searching for all posts for this topic AND that are 'active', this way there is no filtering of posts, your only returning what will be displayed!?
That's the point, there IS filtering. Every condition you add is a filter, that's how it works.

The problem isn't that you have a filter. It's that you have a filter that is mostly useless for filtering.

On the bulk of forums, this 'active' variable is going to be 'yes' on pretty much every post. Which means MySQL won't bother to use the index and will just happily go through every row trying to find the ones that are active.

On the other hand, if you explicitly tell it to find the values that aren't yes, the index will be very useful because it's doing what it would do best: finding rows selectively.

Even if we make it a single 'status' field that covers for both approval and soft deletion and even separate out deletion by user vs deletion by moderator for display purposes, that still means we have to deal with: active, waiting approval, soft deleted by user, soft deleted by moderator - 4 values (6 if you count waiting-approval-but-soft-deleted possibilities)

But the index is still going to be massively unbalanced because of the number of cases there will be of 'active' vs all the rest, to the point where MySQL won't touch the index. But it will explicitly have to go through every row manually to find 'active' as opposed to not having to explicitly check these things.


The sad truth is, what most people think is how MySQL works is not really how it works at all. There are entire textbooks on how to optimise queries by dealing with indexes.

ziycon

  • Posts: 126
Re: Post Deletion
« Reply #9, on May 2nd, 2013, 01:29 PM »
I see what you mean, point taken.