Requests for comment/Page deletion

This page serves as ground for discussion on the best way to integrate RevDelete with normal page deletion. Wikitech thread:

Particularly, moving page deletion to a RevDelete mechanism would solve:
 * 21279 RevDelete + Normal deletion break log links.
 * 18104 Deleted revisions should be identified by id, not timestamp.
 * Easy comparison between deleted revisions and existing ones.
 * It is really expensive to delete pages with lots of revisions.
 * Page protection can be kept on delete + undelete cycles.

archived_page table
Use a table similar to page which holds page content when it is deleted.

Deleting a page is moving the page entry to a new entry in the archived_page table.

We could have different deleted pages: groups of revisions which once existed at the same history. So revisions are no longer mixed. Each deleted page has a different page_id (although they share namespace and title). In such case, page creation produces a new page_id.

Otherwise, page creation recovers the entry from archived_page.

page_deleted field
Add a page_deleted field to the table page.

The page is marked on the page_deleted bitfield as no longer existing. Another option would be to define that page doesn't exist if it has no visible [latest] edit.

Page creation reuses the same page entry if it exists.

Delete revisions on page deletion?
With either approach, we could mark as deleted all revisions or rely on the page change to not allow them to be accessed. The later favours fast deletion and undeletion. The first aims for consistency. However, deleting one revision, then deleting the full page and undeleting should have kept that revision gone...