Re: _bt_check_unique checks every row in table when doing update??

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mats Lofkvist <mal(at)algonet(dot)se>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: _bt_check_unique checks every row in table when doing update??
Date: 2002-09-12 16:26:47
Message-ID: 200209121626.g8CGQl804506@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> > (In my case, I think the call to _bt_check_unique could be
> > avoided altogether since the update isn't changing any of
> > the columns present in the unique key.
>
> It's fairly difficult for the index AM to know that; in general we don't
> have access to the old tuple to check, at the time the index update is
> running.

We do have a TODO item:

* Prevent index uniqueness checks when UPDATE does not modifying column

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message junk 2002-09-12 17:06:17 Re: HELP
Previous Message xayk 2002-09-12 15:37:39 unsubscribe *