Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Postgres 8.3 HOT and non-persistent xids


  • From: "Mike C" <smith(dot)not(dot)western(at)gmail(dot)com>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Postgres 8.3 HOT and non-persistent xids
  • Date: Thu, 20 Dec 2007 11:14:33 +1300
  • Message-id: <bd0eabd0712191414o64aa5193w5fe57dff622c178c(at)mail(dot)gmail(dot)com>

Hi,

Can someone clarify HOT updates for me (and perhaps put more detail
into the docs?). Is this statement correct: the HOT technique is used
on *any* table so long as no indexed column is affected.

create table T (A int, B int);
create index TB on T (B);
insert into T (A,B) Values (1,2);

So if I do an update that is identical to the existing row, nothing changes?

update T set A=1, B=2 where A=1;

If I change the non-indexed field, A, then HOT applies and no new tuple needed?

update T set A=2, B=2 where A=1;

If I change the indexed field, B, then HOT doesn't apply and a new
tuple is needed?

update T set A=2,B=3 where A=2;

Is that correct?

Actually, what actually happens when you get an update with redundant
information, e.g.

update T set A=2,B=4 where A=2;

The value of A hasn't changed, does postgres still write the value?

And for non-persistent transaction ids, the documentation says that
this is for read-only transactions. What defines a read-only
transaction for this purpose? Does postgres check to see if a SELECT
includes e.g. a sequence change via nextval? If I mark the transaction
as readonly using the PG JDBC driver, will that be sufficient?

Thank you,

Mike



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group