dbTalk Databases Forums  

implementing a database log

comp.databases.theory comp.databases.theory


Discuss implementing a database log in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM






Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #12  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM






Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #13  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #14  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #15  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #16  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #17  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #18  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #19  
Old   
Christoph Rupp
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 04:58 PM



Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Quote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified, added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.
It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...



Reply With Quote
  #20  
Old   
Brian Selzer
 
Posts: n/a

Default Re: implementing a database log - 04-21-2008 , 05:58 PM




"Christoph Rupp" <cruppstahl (AT) gmail (DOT) com> wrote

Quote:
Brian,

On Apr 21, 11:00 pm, "Brian Selzer" <br... (AT) selzer-software (DOT) com> wrote:
Why not go with #4:

4. a physical log based on modified rows. Whenever a row is modified,
added
or removed, it is logged. Then you could also implement row
versioning--just add a row version field to the physical rows. I believe
that this what snapshot isolation is built on.

It's not an SQL database, i don't even have the notion of "rows", but
basically i think your #4 is the same as my #1 or #2.

No, it isn't. #1 requires the logging of additional records that may not
have been affected by an update. #2 doesn't log the entire changed record,
but only bits and pieces. I would think that limiting the units of change
to individual records--entire records--would simplify the process of marking
and isolating units of work while at the same time guaranteeing consistency.

Quote:
My problem is that one single insert can be split in up to 3 or even
more file operations, depending on the size of the B+Tree index (it
has to be split, if a page overflows, etc). I don't have an atomic
"insert(key, value)" operation.

Perhaps you should focus on that, then.

Quote:
And in that case, i have to log 3 (or more) different file events. And
that brings me back to my question - do i log the whole modified page
(usually a page is between 16kb and 64kb), or just the modified region
in the page...

Again, I say neither. You should log only those records that have changed:
discard the notion of logging pages or segments of pages--instead, log
records or sets of records. It is not enough in a concurrent environment to
reconstruct a snapshot of the physical media at a particular point in time.
An update may encompass many file operations; therefore, a reconstruction of
just the snapshot will almost certainly be inconsistent and will require
rolling back or rolling forward the result of any transactions that were
outstanding at the point in time of the snapshot.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.