Page MenuHomePhabricator

Make sure revision queries JOIN on page in most places
Open, MediumPublic


Per, we want to move away from using the archive table. One thing that can be done right now to prep for that is to make sure revision queries join on rev_page=page_id to make sure the revisions returned are live (unless the caller doesn't care if they are orphaned).

A future deletion schema will involve moving page rows to an archived_page table. Revisions not belonging to a 'page' row would be "deleted". Many places already JOIN on page, which works out nicely.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:48 PM
bzimport set Reference to bz31864.
bzimport added a subscriber: Unknown Object (MLST).

Core code looks OK as of r101030.

It's OK to have:

  • JOIN rev_page=rev_id
  • WHERE rev_page = <some ID from a live title)
  • WHERE rev_id=page_latest

sumanah wrote:

We still need to cover extensions.

sumanah wrote:

Adding Yuvi to this bug since he said he'd take a look at this.

I may be better in most cases to do a LinkBatch query (e.g. Pager::doBatchLookups) rather than a JOIN in most places.