Re: Sequential vs. random values - number of pages in B-tree - Mailing list pgsql-general

From Ilya Kazakevich
Subject Re: Sequential vs. random values - number of pages in B-tree
Date
Msg-id 006201d1f948$1ebd9ec0$5c38dc40$@JetBrains.com
Whole thread Raw
In response to Sequential vs. random values - number of pages in B-tree  (pinker <pinker@onet.eu>)
List pgsql-general
Hi,

>What's the reason that postgres needs more index pages to store random
>data
>than sequential ones?

I assume that is because B-Tree is self-balanced tree, so it needs to be
rebalanced after each insertion.
Random insertions may go to the head of index where no space left leading to
huge data moving.
https://en.wikipedia.org/wiki/B-tree#Insertions_and_deletions



Ilya Kazakevich

JetBrains
http://www.jetbrains.com
The Drive to Develop



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: PGPASSWORD - More than one in a bash script
Next
From: pinker
Date:
Subject: Re: Sequential vs. random values - number of pages in B-tree