From: | "Imai, Yoshikazu" <imai(dot)yoshikazu(at)jp(dot)fujitsu(dot)com> |
---|---|
To: | 'Alexander Korotkov' <a(dot)korotkov(at)postgrespro(dot)ru> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | RE: Locking B-tree leafs immediately in exclusive mode |
Date: | 2018-07-25 02:53:57 |
Message-ID: | 0F97FA9ABBDBE54F91744A9B37151A5118EC3F@g01jpexmbkw24 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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.
Yoshikazu Imai
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2018-07-25 04:59:00 | Re: [HACKERS] plpgsql - additional extra checks |
Previous Message | Andres Freund | 2018-07-25 02:49:56 | Re: LLVM jit and matview |