Update comment for README.HOT

Started by Bruce Momjianover 15 years ago6 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

I would like to apply the attached patch to README.HOT so clarify when
single-page cleanup happens, e.g. not during INSERT.

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

+ It's impossible for everything to be true. +

Attachments:

/pgpatches/HOTtext/x-diffDownload+6-0
#2Thom Brown
thom@linux.com
In reply to: Bruce Momjian (#1)
Re: Update comment for README.HOT

On 17 September 2010 20:52, Bruce Momjian <bruce@momjian.us> wrote:

I would like to apply the attached patch to README.HOT so clarify when
single-page cleanup happens, e.g. not during INSERT.

"... when the page is nearly full (<10%) ..."

Shouldn't that be >90%?

"... while INSERT ... VALUES cannot because it does not retrieve a row."

Is this still true when it's used in conjunction with RETURNING?

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: Update comment for README.HOT

Bruce Momjian <bruce@momjian.us> writes:

+ This means that UPDATE, DELETE, and SELECT can trigger space
+ reclamation, while INSERT ... VALUES cannot because it does not retrieve
+ a row.

I don't believe that's correct. It might have happened to work that way
for you in a particular test. It's certainly not something I'd document
as being intended long-term behavior.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Thom Brown (#2)
Re: Update comment for README.HOT

Thom Brown wrote:

On 17 September 2010 20:52, Bruce Momjian <bruce@momjian.us> wrote:

I would like to apply the attached patch to README.HOT so clarify when
single-page cleanup happens, e.g. not during INSERT.

"... when the page is nearly full (<10%) ..."

Shouldn't that be >90%?

"... while INSERT ... VALUES cannot because it does not retrieve a row."

Is this still true when it's used in conjunction with RETURNING?

I think returning might cause a clean --- I have not tested that.

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

+ It's impossible for everything to be true. +

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: Update comment for README.HOT

Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

+ This means that UPDATE, DELETE, and SELECT can trigger space
+ reclamation, while INSERT ... VALUES cannot because it does not retrieve
+ a row.

I don't believe that's correct. It might have happened to work that way
for you in a particular test. It's certainly not something I'd document
as being intended long-term behavior.

Well, I would like to document something about this because I was
surprised that when INSERT did not trigger a cleanup. I realize we
might change the behavior but then we would update the file too,
hopefully.

How is the attached version using "often"? I also clarified it is < 10%
free.

I found this while doing tests for a new MVCC talk I will be delivering
at PG West.

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

+ It's impossible for everything to be true. +

Attachments:

/pgpatches/HOTtext/plainDownload+6-0
#6Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#5)
Re: Update comment for README.HOT

Applied.

---------------------------------------------------------------------------

Bruce Momjian wrote:

Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

+ This means that UPDATE, DELETE, and SELECT can trigger space
+ reclamation, while INSERT ... VALUES cannot because it does not retrieve
+ a row.

I don't believe that's correct. It might have happened to work that way
for you in a particular test. It's certainly not something I'd document
as being intended long-term behavior.

Well, I would like to document something about this because I was
surprised that when INSERT did not trigger a cleanup. I realize we
might change the behavior but then we would update the file too,
hopefully.

How is the attached version using "often"? I also clarified it is < 10%
free.

I found this while doing tests for a new MVCC talk I will be delivering
at PG West.

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

+ It's impossible for everything to be true. +

Index: src/backend/access/heap/README.HOT
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/heap/README.HOT,v
retrieving revision 1.6
diff -c -c -r1.6 README.HOT
*** src/backend/access/heap/README.HOT	23 Apr 2010 23:21:44 -0000	1.6
--- src/backend/access/heap/README.HOT	17 Sep 2010 21:21:56 -0000
***************
*** 246,251 ****
--- 246,257 ----
is arbitrarily capped at MaxHeapTuplesPerPage (the most tuples that
could fit without HOT pruning).
+ Effectively, space reclamation happens during tuple retrieval when the
+ page is nearly full (<10% free) and a buffer cleanup lock can be
+ acquired.  This means that UPDATE, DELETE, and SELECT can trigger space
+ reclamation, but often not during INSERT ... VALUES because it does
+ not retrieve a row.
+ 

VACUUM
------

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

+ It's impossible for everything to be true. +