Re: [HACKERS] Burst in WAL size when UUID is used as PK whilefull_page_writes are enabled - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Burst in WAL size when UUID is used as PK whilefull_page_writes are enabled
Date
Msg-id 20171027120653.5tcqw3dnu7s3gfd5@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] Burst in WAL size when UUID is used as PK whilefull_page_writes are enabled  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [HACKERS] Burst in WAL size when UUID is used as PK whilefull_page_writes are enabled
List pgsql-hackers
Amit Kapila wrote:

> You might want to give a try with the hash index if you are planning
> to use PG10 and your queries involve equality operations.

So, btree indexes on monotonically increasing sequences don't write tons
of full page writes because typically the same page is touched many
times by insertions on each checkpoint cycle; so only one or very few
full page writes are generated for a limited number of index pages.

With UUID you lose locality of access: each insert goes to a different
btree page, so you generate tons of full page writes because the number
of modified index pages is very large.

With hash on monotonically increasing keys, my guess is that you get
behavior similar to btrees on UUID: the inserts are all over the place
in the index, so tons of full page writes.  Am I wrong?

With hash on UUID, the same thing should happen.  Am I wrong?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Burst in WAL size when UUID is used as PK whilefull_page_writes are enabled
Next
From: Thomas Kellerer
Date:
Subject: [HACKERS] Re: Burst in WAL size when UUID is used as PK whilefull_page_writes are enabled