Unix Technical Forum

MVCC, undo log, and HOT

This is a discussion on MVCC, undo log, and HOT within the pgsql Hackers forums, part of the PostgreSQL category; --> Those who have been with the community from long ago might remember discussion about implementing a undo log. The ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 10:28 PM
Bruce Momjian
 
Posts: n/a
Default MVCC, undo log, and HOT

Those who have been with the community from long ago might remember
discussion about implementing a undo log. The big advantage of this is
that it allows UPDATE to _replace_ rows and limits the amount of cleanup
required for UPDATEs.

I am hoping that with HOT we will no longer have any need to even
consider undo.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 10:28 PM
Josh Berkus
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

Bruce Momjian wrote:
> Those who have been with the community from long ago might remember
> discussion about implementing a undo log. The big advantage of this is
> that it allows UPDATE to _replace_ rows and limits the amount of cleanup
> required for UPDATEs.
>
> I am hoping that with HOT we will no longer have any need to even
> consider undo.
>


We were considering it?

I certainly wasn't. I've enough experience with Oracle and InnoDB to
see that an undo log is its own set of performance issues. No thanks.

Hopefully the "multi-thread the backend" idea is dead, too.

--Josh

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 10:28 PM
Joshua D. Drake
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

Josh Berkus wrote:
> Bruce Momjian wrote:
>> Those who have been with the community from long ago might remember
>> discussion about implementing a undo log. The big advantage of this is
>> that it allows UPDATE to _replace_ rows and limits the amount of cleanup
>> required for UPDATEs.
>>
>> I am hoping that with HOT we will no longer have any need to even
>> consider undo.
>>

>
> We were considering it?


I don't ever remember us considering it seriously.

>
> I certainly wasn't. I've enough experience with Oracle and InnoDB to
> see that an undo log is its own set of performane issues. No thanks.
>


It certainly does.

Joshua D. Drake

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-15-2008, 10:29 PM
Bruce Momjian
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

Joshua D. Drake wrote:
> Josh Berkus wrote:
> > Bruce Momjian wrote:
> >> Those who have been with the community from long ago might remember
> >> discussion about implementing a undo log. The big advantage of this is
> >> that it allows UPDATE to _replace_ rows and limits the amount of cleanup
> >> required for UPDATEs.
> >>
> >> I am hoping that with HOT we will no longer have any need to even
> >> consider undo.
> >>

> >
> > We were considering it?

>
> I don't ever remember us considering it seriously.
>
> >
> > I certainly wasn't. I've enough experience with Oracle and InnoDB to
> > see that an undo log is its own set of performane issues. No thanks.
> >

>
> It certainly does.


We never actually considred undo, but high UPDATE activity was one of
the areas we historically handled poorly compared to undo systems, and
undo would have been one way to improve that area. I think with HOT we
have improved high UPDATE activity enough that the undo benefits are no
longer attractive (and of course the undo disadvantages were never
attractive).

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-15-2008, 10:29 PM
Josh Berkus
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

Bruce,

> We never actually considred undo, but high UPDATE activity was one of
> the areas we historically handled poorly compared to undo systems, and
> undo would have been one way to improve that area. I think with HOT we
> have improved high UPDATE activity enough that the undo benefits are no
> longer attractive (and of course the undo disadvantages were never
> attractive).
>


If you're asking if we should remove the TODO (is there one?) and
replace it with a FAQ item called "Why PostgreSQL doesn't have an UNDO
LOG", then my vote is "yes".

--Josh


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-15-2008, 10:29 PM
Bruce Momjian
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

Josh Berkus wrote:
> Bruce,
>
> > We never actually considred undo, but high UPDATE activity was one of
> > the areas we historically handled poorly compared to undo systems, and
> > undo would have been one way to improve that area. I think with HOT we
> > have improved high UPDATE activity enough that the undo benefits are no
> > longer attractive (and of course the undo disadvantages were never
> > attractive).
> >

>
> If you're asking if we should remove the TODO (is there one?) and
> replace it with a FAQ item called "Why PostgreSQL doesn't have an UNDO
> LOG", then my vote is "yes".


No, it never got close to being a TODO item. It was more a limitation
we had that is now fixed.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-15-2008, 10:29 PM
Andrew Dunstan
 
Posts: n/a
Default Re: MVCC, undo log, and HOT



Bruce Momjian wrote:
> Josh Berkus wrote:
>
>> Bruce,
>>
>>
>>> We never actually considred undo, but high UPDATE activity was one of
>>> the areas we historically handled poorly compared to undo systems, and
>>> undo would have been one way to improve that area. I think with HOT we
>>> have improved high UPDATE activity enough that the undo benefits are no
>>> longer attractive (and of course the undo disadvantages were never
>>> attractive).
>>>
>>>

>> If you're asking if we should remove the TODO (is there one?) and
>> replace it with a FAQ item called "Why PostgreSQL doesn't have an UNDO
>> LOG", then my vote is "yes".
>>

>
> No, it never got close to being a TODO item. It was more a limitation
> we had that is now fixed.
>


HOT is cool, but it really doesn't solve the whole problem. It works for
a significant class of problems, but for example it won't have any
significant effect on the app I'm currently working on which is very
index-rich. It would be a major mistake to think there's no work left to
do in improving update performance.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-15-2008, 10:29 PM
Gregory Stark
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

"Andrew Dunstan" <andrew@dunslane.net> writes:

> HOT is cool, but it really doesn't solve the whole problem. It works for a
> significant class of problems, but for example it won't have any significant
> effect on the app I'm currently working on which is very index-rich. It would
> be a major mistake to think there's no work left to do in improving update
> performance.


Another use case it doesn't address is updating a large fraction of the table.
If you do a single unconstrained "UPDATE foo SET x=y" your table and indexes
will double in size and never shrink back.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-15-2008, 10:29 PM
Simon Riggs
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

On Mon, 2007-10-22 at 11:00 -0400, Bruce Momjian wrote:
> Joshua D. Drake wrote:
> > Josh Berkus wrote:
> > > Bruce Momjian wrote:
> > >> Those who have been with the community from long ago might remember
> > >> discussion about implementing a undo log. The big advantage of this is
> > >> that it allows UPDATE to _replace_ rows and limits the amount of cleanup
> > >> required for UPDATEs.
> > >>
> > >> I am hoping that with HOT we will no longer have any need to even
> > >> consider undo.
> > >>
> > >
> > > We were considering it?

> >
> > I don't ever remember us considering it seriously.
> >
> > >
> > > I certainly wasn't. I've enough experience with Oracle and InnoDB to
> > > see that an undo log is its own set of performane issues. No thanks.
> > >

> >
> > It certainly does.

>
> We never actually considred undo


I did, but eventually ruled it out during the HOT design process. But
then I considered a ton of other things and ruled them out also.

Can't see a reason to bring it up again, so perhaps we should add it to
the definitely don't want list. Don't *need* would be better.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-15-2008, 10:29 PM
Jonah H. Harris
 
Posts: n/a
Default Re: MVCC, undo log, and HOT

On 10/23/07, Andrew Dunstan <andrew@dunslane.net> wrote:
> It would be a major mistake to think there's no work left to
> do in improving update performance.


Agreed. That would be a very short-sighted move.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:52 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com