The database is already under heavy load. The fine art of database retrieval involves getting the database to do as much as possible, in order to return as little as possible. It's therefor somewhat counter-productive to ask a database to fetch a somewhat lengthy string of bytes only to then reprocess it in order to use the last bit.

Theoretically, one would add a new table that contains the node_id, revision tuple and fetch the latest revision with select max(node_id), revision from latest_node_revision with a join on the node_id from some other table.

Pratically, that might be a net loss. It might be better to store revisions in the existing node contents. That would require significant reworking of the existing code to make sure it reprocessed the node contents to only pull out the last revision. Down that path lies madness. (Although if I had to envisage doing such a thing in other circumstances, I would encode the different chunks as MIME entities rather than reinvent that particular wheel).

I'm also pretty sure that nodes have a hard upper limit of 64kb. Storing multiple revisions of lengthy nodes would quickly blow past that limit. All other things being equal, a lengthy node is also more likely to be tweaked.

My feeling is that thepen's Perl Monk Archive is sufficient to get the (approximately) original view of the node. And if someone really wants to wipe out the contents of their nodes, these can always be restored from tape (this has happened before, with mt2k and tye in the roles of reaper and restorer).


In reply to Re: Storing node revision history by grinder
in thread Storing node revision history by BUU

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.