Re: WIP: Covering + unique indexes.

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, Thomas Munro <thomas.munro@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Anastasia Lubennikova <lubennikovaav@gmail.com>
Date: 2018-03-28T13:27:13Z
Lists: pgsql-hackers

Attachments

Hi!

> 21 марта 2018 г., в 21:51, Alexander Korotkov <a.korotkov@postgrespro.ru> написал(а):
> 
> 
> I took a look at this patchset.  I have some notes about it.
> 
> * I see patch changes dblink, amcheck and tcl contribs.  It would be nice to add corresponding
> check to dblink and amcheck regression tests.  It would be good to do the same with tcn contrib.
> But tcn doesn't have regression tests at all.  And it's out of scope of this patch to add regression
> tests to tcn.  So, it's OK to just check that it's working correctly with covering indexes (I hope it's
> already done by other reviewers).
> 
I propose attached tests to amcheck and dblink. Not very extensive tests though, but enough to keep things working.
> * I think that subscription regression tests in src/test/subscription should have some use
> of covering indexes.  Logical decoding and subscription are heavily using primary keys.
> So they need to be tested to work correctly with covering indexes.
I've attached subscription tests. Unfortunately, they crash publisher with
2018-03-28 15:09:05.953 +05 [81805] 001_rep_changes.pl LOG:  statement: DELETE FROM tab_cov WHERE a > 20
2018-03-28 15:09:05.954 +05 [81691] LOG:  server process (PID 81805) was terminated by signal 11: Segmentation fault
Any of this commands lead to this
$node_publisher->safe_psql('postgres', "DELETE FROM tab_cov WHERE a > 20");
$node_publisher->safe_psql('postgres', "UPDATE tab_cov SET a = -a");


I didn't succeed in debugging. Maybe Anastasia can comment on is it bug or is it something wrong with tests?
> 
> * I also think some isolation tests in src/test/isolation need to check covering indexes too.
> In particular insert-conflict-*.spec and lock-*.spec and probably more.
Currently, I couldn't compose good test scenarios, but I will think a bit about it more.

Best regards, Andrey Borodin.

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