Skip to content

Commit

Permalink
Adjust the 3 shell scripts used for performance measurements (located…
Browse files Browse the repository at this point in the history
… into tools/performance sub directories). Use the recent emaj_assign_tables() function to create the tables groups, instead of populating the emaj_group_def table. In the rollback_perf.sh script, also fix VACUUM statements on log tables. They used the old log table names.
  • Loading branch information
beaud76 committed Mar 4, 2020
1 parent 01c64f8 commit 21339b6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 37 deletions.
11 changes: 5 additions & 6 deletions tools/performance/large_group/large_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export SCALEFACTOR=1000 # number of tables for the group

export PGHOST=localhost
export PGPORT=5410
export PGPORT=5412
export PGUSER=postgres
export PGDATABASE=regression

Expand Down Expand Up @@ -63,13 +63,12 @@ create function update_tbl(v_nb_tbl int) returns void language plpgsql as
select create_tbl(:p_scaleFactor);
delete from emaj.emaj_group_def;
insert into emaj.emaj_group_def (grpdef_group,grpdef_schema,grpdef_tblseq)
select 'large_group','large_schema', 't' || to_char(i,'000000FM') from generate_series(1, :p_scaleFactor) i;
checkpoint;
select emaj.emaj_create_group('large_group');
select emaj.emaj_create_group('large_group',true,true);
select emaj.emaj_assign_tables('large_schema','.*','','large_group');
select emaj.emaj_start_group('large_group','mark1');
select update_tbl(:p_scaleFactor);
Expand Down
8 changes: 3 additions & 5 deletions tools/performance/log_overhead/pgbench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# To get a base measurement without E-Maj, comment the emaj_start_group() function call

export PGHOST=localhost
export PGPORT=5410
export PGPORT=5412
export PGUSER=postgres
export PGDATABASE=regression

Expand All @@ -24,10 +24,8 @@ CREATE EXTENSION dblink;
CREATE EXTENSION emaj;
-- create the tables group
INSERT INTO emaj.emaj_group_def (grpdef_group, grpdef_schema, grpdef_tblseq)
SELECT 'bench', table_schema, table_name FROM information_schema.tables
WHERE table_schema = 'public';
SELECT emaj.emaj_create_group('bench', false); -- the group is created in AUDIT_ONLY mode because pgbench_history has no PK
SELECT emaj.emaj_create_group('bench', false, true); -- the group is created in AUDIT_ONLY mode because pgbench_history has no PK
SELECT emaj.emaj_assign_tables('public','.*','','bench');
-- start the tables group
SELECT emaj.emaj_start_group('bench','start');
Expand Down
50 changes: 24 additions & 26 deletions tools/performance/rollback/rollback_perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export SCALEFACTOR=100 # each step creates 1000 * SCALEFACTOR rows

export PGHOST=localhost
export PGPORT=5410
export PGPORT=5412
export PGUSER=postgres
export PGDATABASE=regression

Expand All @@ -27,9 +27,7 @@ SET client_min_messages TO WARNING;
-- Create structures
-----------------------------------
-- install the E-Maj extension
CREATE EXTENSION btree_gist;
CREATE EXTENSION dblink;
CREATE EXTENSION emaj;
CREATE EXTENSION emaj CASCADE;
create schema perfschema;
set search_path = 'perfschema';
Expand Down Expand Up @@ -57,12 +55,12 @@ primary key (c1)
);
create index on perf2(c2);
delete from emaj.emaj_group_def where grpdef_group like 'perf%';
insert into emaj.emaj_group_def (grpdef_group,grpdef_schema,grpdef_tblseq) values
('perf1','perfschema','perf1'),
('perf2','perfschema','perf2');
select emaj.emaj_create_group('perf1');
select emaj.emaj_create_group('perf2');
select emaj.emaj_create_group('perf1',true,true);
select emaj.emaj_create_group('perf2',true,true);
select emaj.emaj_assign_table('perfschema','perf1','perf1');
select emaj.emaj_assign_table('perfschema','perf2','perf2');
select emaj.emaj_start_group(group_name,'init') from emaj.emaj_group where group_name like 'perf%';
vacuum analyze;
Expand All @@ -79,7 +77,7 @@ insert into perf1 select i, 2, 3, 4, 5, 6, 7, 8 from generate_series (1, 1000*:p
select emaj.emaj_start_group('perf1','init');
insert into perf1 select c1, 0, c3, c4, c5, c6, c7, c8 from perf1 where c1 % 10 = 0;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_rollback_group('perf1','init');
--> logged rollback on insert only
Expand All @@ -89,7 +87,7 @@ insert into perf1 select i, 2, 3, 4, 5, 6, 7, 8 from generate_series (1, 1000*:p
select emaj.emaj_start_group('perf1','init');
insert into perf1 select c1, 0, c3, c4, c5, c6, c7, c8 from perf1 where c1 % 10 = 0;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_logged_rollback_group('perf1','init');
--> rollback on update only
Expand All @@ -99,7 +97,7 @@ insert into perf1 select i, 2, 3, 4, 5, 6, 7, 8 from generate_series (1, 1000*:p
select emaj.emaj_start_group('perf1','init');
update perf1 set c2 = 0 where c1 % 10 = 1;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_rollback_group('perf1','init');
--> logged rollback on update only
Expand All @@ -109,7 +107,7 @@ insert into perf1 select i, 2, 3, 4, 5, 6, 7, 8 from generate_series (1, 1000*:p
select emaj.emaj_start_group('perf1','init');
update perf1 set c2 = 0 where c1 % 10 = 1;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_logged_rollback_group('perf1','init');
--> rollback on delete only
Expand All @@ -119,7 +117,7 @@ insert into perf1 select i, 2, 3, 4, 5, 6, 7, 8 from generate_series (1, 1000*:p
select emaj.emaj_start_group('perf1','init');
delete from perf1 where c1 % 10 = 2;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_rollback_group('perf1','init');
--> logged rollback on delete only
Expand All @@ -129,7 +127,7 @@ insert into perf1 select i, 2, 3, 4, 5, 6, 7, 8 from generate_series (1, 1000*:p
select emaj.emaj_start_group('perf1','init');
delete from perf1 where c1 % 10 = 2;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_logged_rollback_group('perf1','init');
--> rollback on insert/update/delete mix
Expand All @@ -141,7 +139,7 @@ insert into perf1 select c1, 0, c3, c4, c5, c6, c7, c8 from perf1 where c1 % 10
update perf1 set c2 = 0 where c1 % 10 = 1;
delete from perf1 where c1 % 10 = 2;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_rollback_group('perf1','init');
--> logged rollback on delete only
Expand All @@ -153,7 +151,7 @@ insert into perf1 select c1, 0, c3, c4, c5, c6, c7, c8 from perf1 where c1 % 10
update perf1 set c2 = 0 where c1 % 10 = 1;
delete from perf1 where c1 % 10 = 2;
vacuum analyze perf1;
vacuum analyze emaj.perfschema_perf1_log;
vacuum analyze emaj_perfschema.perf1_log;
select emaj.emaj_logged_rollback_group('perf1','init');
-----------------------------------
Expand All @@ -167,7 +165,7 @@ insert into perf2 select i, rpad('2',300), rpad('3',300), rpad('4',300) from gen
select emaj.emaj_start_group('perf2','init');
insert into perf2 select -c1, c2, c3, c4 from perf2 where c1 % 10 = 0;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_rollback_group('perf2','init');
--> logged rollback on insert only
Expand All @@ -177,7 +175,7 @@ insert into perf2 select i, rpad('2',300), rpad('3',300), rpad('4',300) from gen
select emaj.emaj_start_group('perf2','init');
insert into perf2 select -c1, c2, c3, c4 from perf2 where c1 % 10 = 0;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_logged_rollback_group('perf2','init');
--> rollback on update only
Expand All @@ -187,7 +185,7 @@ insert into perf2 select i, rpad('2',300), rpad('3',300), rpad('4',300) from gen
select emaj.emaj_start_group('perf2','init');
update perf2 set c2 = '' where c1 % 10 = 1;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_rollback_group('perf2','init');
--> logged rollback on update only
Expand All @@ -197,7 +195,7 @@ insert into perf2 select i, rpad('2',300), rpad('3',300), rpad('4',300) from gen
select emaj.emaj_start_group('perf2','init');
update perf2 set c2 = '' where c1 % 10 = 1;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_logged_rollback_group('perf2','init');
--> rollback on delete only
Expand All @@ -207,7 +205,7 @@ insert into perf2 select i, rpad('2',300), rpad('3',300), rpad('4',300) from gen
select emaj.emaj_start_group('perf2','init');
delete from perf2 where c1 % 10 = 2;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_rollback_group('perf2','init');
--> logged rollback on delete only
Expand All @@ -217,7 +215,7 @@ insert into perf2 select i, rpad('2',300), rpad('3',300), rpad('4',300) from gen
select emaj.emaj_start_group('perf2','init');
delete from perf2 where c1 % 10 = 2;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_logged_rollback_group('perf2','init');
--> rollback on insert/update/delete mix
Expand All @@ -229,7 +227,7 @@ insert into perf2 select -c1, c2, c3, c4 from perf2 where c1 % 10 = 0;
update perf2 set c2 = '' where c1 % 10 = 1;
delete from perf2 where c1 % 10 = 2;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_rollback_group('perf2','init');
--> logged rollback on delete only
Expand All @@ -241,7 +239,7 @@ insert into perf2 select -c1, c2, c3, c4 from perf2 where c1 % 10 = 0;
update perf2 set c2 = '' where c1 % 10 = 1;
delete from perf2 where c1 % 10 = 2;
vacuum analyze perf2;
vacuum analyze emaj.perfschema_perf2_log;
vacuum analyze emaj_perfschema.perf2_log;
select emaj.emaj_logged_rollback_group('perf2','init');
**PSQL1**
Expand Down

0 comments on commit 21339b6

Please sign in to comment.