Re: WIP: Covering + unique indexes.
Amit Kapila <amit.kapila16@gmail.com>
On Tue, Sep 20, 2016 at 10:51 AM, Amit Kapila <amit.kapila16@gmail.com> wrote: > On Tue, Sep 6, 2016 at 10:18 PM, Anastasia Lubennikova > <a.lubennikova@postgrespro.ru> wrote: >> 28.08.2016 09:13, Amit Kapila: >> >> On Mon, Aug 15, 2016 at 8:15 PM, Anastasia Lubennikova >> <a.lubennikova@postgrespro.ru> wrote: >> >> >> So the patch is correct. >> We can go further and remove this index_truncate_tuple() call, because >> the first key of any inner (or root) page doesn't need any key at all. >> > > Anyway, I think truncation happens if the page is at leaf level and > that is ensured by check, so I think we can't remove this: > + if (indnkeyatts != indnatts && P_ISLEAF(pageop)) > > > -- I have one more question regarding this truncate high-key concept. > I think if high key is truncated, then during insertion, for cases > like below it move to next page, whereas current page needs to be > splitted. > > Assume index on c1,c2,c3 and c2,c3 are including columns. > > Actual high key on leaf Page X - > 3, 2 , 2 > Truncated high key on leaf Page X > 3 > > New insertion key > 3, 1, 2 > > Now, I think for such cases during insertion if the page X doesn't > have enough space, it will move to next page whereas ideally, it > should split current page. Refer function _bt_findinsertloc() for > this logic. > Basically, here I wanted to know is that do we maintain ordering for keys with respect to including columns while storing them (In above example, do we ensure that 3,1,2 is always stored before 3,2,2)? > > > -- I am getting Assertion failure when I use this patch with database > created with a build before this patch. However, if I create a fresh > database it works fine. Assertion failure details are as below: > I have tried this test on my Windows m/c only. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
Commits
-
Adjust INCLUDE index truncation comments and code.
- 075aade4361b 11.0 landed
-
Add commentary explaining why MaxIndexTuplesPerPage calculation is safe.
- 2a67d6440db4 11.0 cited
-
Indexes with INCLUDE columns and their support in B-tree
- 8224de4f42cc 11.0 landed
-
Add amcheck verification of heap relations belonging to btree indexes.
- 7f563c09f890 11.0 cited
-
Doc: move info for btree opclass implementors into main documentation.
- 3785f7eee3d9 11.0 cited
-
Doc: mention that you can't PREPARE TRANSACTION after NOTIFY.
- e4fbf22831c2 11.0 cited
-
Remove dedicated B-tree root-split record types.
- 0c504a80cf2e 11.0 cited
-
Restructure index access method API to hide most of it at the C level.
- 65c5fcd353a8 9.6.0 cited
-
Split _bt_insertonpg to two functions.
- bc292937ae6a 8.3.0 cited
-
Major overhaul of btree index code. Eliminate special BTP_CHAIN logic for
- 9e85183bfc31 7.1.1 cited