Re: _bt_check_unique checks every row in table when doing update?? - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: _bt_check_unique checks every row in table when doing update??
Date
Msg-id 200209121626.g8CGQl804506@candle.pha.pa.us
Whole thread Raw
In response to Re: _bt_check_unique checks every row in table when doing update??  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-bugs by date:

Previous
From: xayk
Date:
Subject: unsubscribe *
Next
From: junk@ns1.tcu-inc.com
Date:
Subject: Re: HELP