On Wed, Jul 25, 2018 at 5:54 AM Imai, Yoshikazu <imai.yoshik...@jp.fujitsu.com> wrote: > On Mon, July 9, 2018 at 3:19 AM, Imai, Yoshikazu wrote: > > I'm planning to do code review and send it in the next mail. > > Sorry for delaying the code review. > > I did the code review, and I think there are no logical wrongs > with B-Tree. > > I tested integrity of B-Tree with amcheck just in case. > I execute this test on 16-cores machine with 64GB mem. > > I run B-Tree insertion and deletion simultaneously and execute > 'bt_index_parent_check' periodically. > I also run B-Tree insertion and update simultaneously and execute > 'bt_index_parent_check' periodically. > > ## DDL > create table mytab (val1 int, val2 int); > create index mytabidx on mytab (val1, val2); > > ## script_integrity_check_insert.sql > \set i random(1, 100) > \set j random(1, 100) > insert into mytab values (:i, :j); > > ## script_integrity_check_delete.sql > \set i random(1, 100) > \set j random(1, 100) > delete from mytab where val1 = :i and val2 = :j > > ## script_integrity_check_update.sql > \set i random(1, 100) > \set j random(1, 100) > \set k random(1, 100) > \set l random(1, 100) > update mytab set val1 = :k, val2 = :l where val1 = :i and val2 = :j > > ## commands(insert, delete, simultaneously executed) > pgbench -T 60 -P 1 -M prepared -f script_integrity_check_insert.sql -c 2 > postgres > pgbench -T 60 -P 1 -M prepared -f script_integrity_check_delete.sql -c 2 > postgres > > ## commands(insert, update, simultaneously executed) > pgbench -T 60 -P 1 -M prepared -f script_integrity_check_insert.sql -c 2 > postgres > pgbench -T 60 -P 1 -M prepared -f script_integrity_check_update.sql -c 2 > postgres > > ## commands(executed during above insert, delete, update) > (psql) select bt_index_parent_check('mytabidx'); > > > Finally, I confirmed there are no integrity problems during B-Tree operation. > > Lefted tasks in my review is doing the regression tests.
Cool, thank you for review! ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company