Subject | Re: [firebird-support] Re: UPDATE to same record causing heavy disk I/O |
---|---|
Author | Ann Harrison |
Post date | 2015-12-23T22:01:17Z |
On Wed, Dec 23, 2015 at 12:01 PM, Dmitry Yemanov dimitr@... [firebird-support] <firebird-support@yahoogroups.com> wrote:23.12.2015 01:36, Ann Harrison wrote:
>
> ...Your first update will create a back
> version that's just the difference between the old record state and the
> new state. The second (or maybe third) will create a back version
> that's the whole record (IIRC) - much larger and possibly off page.
Correct, but from another side third, fourth, etc updates will not
create any new versions. May be worth checking whether a "heavy" second
update could be better than creating a long version chain.Right. When we were working on InterBase 1.1 (I think) a friend of Jim's suggested using deltas for back versions to save space. He's still a friend, but that feature was a real trial to implement and debug, partly because we ran out of bits in the record header. There's one that says "the version behind me is a delta", but not one that says "I am a delta." The first one is essential because it means that you've got to set up a copy of the record on which to apply deltas. The second would have been very nice for detecting bugs that lead to having the first bit set when it shouldn't be or not set when it should.Once the deltas were working reasonably well, we discovered that some users were updating a single record dozens of times in a transaction. Not a use case we'd considered. I don't remember whether we decided to create a complete back version after two or three updates in one transaction, though I vaguely remember arguing that like Martinis, one or two was pretty reasonable, but after three things are likely to go off in an unexpected direction. With small records, a complete back version saves space compared with three deltas. With big records and small changes... not so much.Cheers,Ann
Dmitry
------------------------------------
Posted by: Dmitry Yemanov <dimitr@...>
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)
<*> To change settings via email:
firebird-support-digest@yahoogroups.com
firebird-support-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/