From: | "HarmeekSingh Bedi" <harmeeksingh(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Question. |
Date: | 2006-12-15 18:13:41 |
Message-ID: | 98de83330612151013y659616cbu396734130126cad8@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi All.
I just looked this email from postgress sql site and wanted to
ask you a question. I would be obliged if you could help me understand
the duplicate key insertion behaviour correctly in Post gress SQL.
The question is related to Btree [Leman and Yao] implementation
When handling duplicate keys
a) Is the key really a duplicate key or TID makes it unique in whole of
the index ?
a) When inserting data into the BTREE in case of leaf nodes we move
to the right in a random behaviourand check if we need to split or
not .
What does the first movedright mean in the code below.
/* Now we are on the right page, so find the insert position. If
we
* moved right at all, we know we should insert at the start of
the
* page, else must find the position by searching.
*/
if (movedright)
newitemoff = P_FIRSTDATAKEY(lpageop);
else
newitemoff = _bt_binsrch(rel, buf, keysz, scankey, false);
b) Once we move right on the leaf , How do we adjust
the parent where to insert once we move right on the
child in case of duplicates.. Does the non leaf contain multiple
duplicate keys as well or is it that the leaf nodes contain multiple
values for the same key .
Can you please help me understand this,
Thanks and appreciate your time.
Regards
Harmeek
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-12-15 19:38:56 | Re: Operator class group proposal |
Previous Message | Andrea C. Granata | 2006-12-15 17:39:03 | gendict and tsearch2 |