Re: WIP: Covering + unique indexes.

Anastasia Lubennikova <a.lubennikova@postgrespro.ru>

From: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
To: Peter Geoghegan <pg@heroku.com>
Cc: David Steele <david@pgmasters.net>, Michael Paquier <michael.paquier@gmail.com>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>, David Rowley <david.rowley@2ndquadrant.com>
Date: 2016-04-06T14:49:09Z
Lists: pgsql-hackers

Attachments

06.04.2016 16:15, Anastasia Lubennikova :
> 06.04.2016 03:05, Peter Geoghegan:
>> * There is some stray whitespace within RelationGetIndexAttrBitmap().
>> I think you should have updated it with code, though. I don't think
>> it's necessary for HOT updates to work, but I think it could be
>> necessary so that we don't need to get a row lock that blocks
>> non-conflict foreign key locking (see heap_update() callers). I think
>> you need to be careful for non-key columns within the loop in
>> RelationGetIndexAttrBitmap(), basically, because it seems to still go
>> through all columns. UPSERT also must call this code, FWIW.
>>
>> * I think that a similar omission is also made for the replica
>> identity stuff in RelationGetIndexAttrBitmap(). Some thought is needed
>> on how this patch interacts with logical decoding, I guess.
>
> Good point. Indexes are everywhere in the code.
> I missed that RelationGetIndexAttrBitmap() is used not only for REINDEX.
> I'll discuss it with Theodor and send an updated patch tomorrow.

As promised, updated patch is in attachments.
But, I'm not an expert in this area, so it needs a 'critical look'.

-- 
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Adjust INCLUDE index truncation comments and code.

  2. Add commentary explaining why MaxIndexTuplesPerPage calculation is safe.

  3. Indexes with INCLUDE columns and their support in B-tree

  4. Add amcheck verification of heap relations belonging to btree indexes.

  5. Doc: move info for btree opclass implementors into main documentation.

  6. Doc: mention that you can't PREPARE TRANSACTION after NOTIFY.

  7. Remove dedicated B-tree root-split record types.

  8. Restructure index access method API to hide most of it at the C level.

  9. Split _bt_insertonpg to two functions.

  10. Major overhaul of btree index code. Eliminate special BTP_CHAIN logic for