Add indexes on Hstore/JSON (#1173)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 8 years ago
parent 22a7ca1698
commit 80b4164d61
  1. 16
      e2e-tests/sbperf.pl

@ -69,7 +69,6 @@ my @legend = (
); );
my $tests = { my $tests = {
( (
$ENV{LLNGTESTLDAP} $ENV{LLNGTESTLDAP}
? ( ? (
@ -191,6 +190,9 @@ my $tests = {
'DROP INDEX IF EXISTS _s1', 'DROP INDEX IF EXISTS _s1',
'DROP INDEX IF EXISTS _u1', 'DROP INDEX IF EXISTS _u1',
'CREATE UNLOGGED TABLE sessions (id varchar(64) not null primary key, a_session hstore)', 'CREATE UNLOGGED TABLE sessions (id varchar(64) not null primary key, a_session hstore)',
"CREATE INDEX uid1 ON sessions ( (a_session -> '_whatToTrace') )",
"CREATE INDEX _s1 ON sessions ( (a_session -> '_session_kind') )",
"CREATE INDEX _u1 ON sessions ( (a_session -> '_utime') )",
], ],
}, },
PgJSON => { PgJSON => {
@ -207,6 +209,9 @@ my $tests = {
'DROP INDEX IF EXISTS _s1', 'DROP INDEX IF EXISTS _s1',
'DROP INDEX IF EXISTS _u1', 'DROP INDEX IF EXISTS _u1',
'CREATE UNLOGGED TABLE sessions (id varchar(64) not null primary key, a_session json)', 'CREATE UNLOGGED TABLE sessions (id varchar(64) not null primary key, a_session json)',
"CREATE INDEX uid1 ON sessions ( (a_session ->> '_whatToTrace') )",
"CREATE INDEX _s1 ON sessions ( (a_session ->> '_session_kind') )",
"CREATE INDEX _u1 ON sessions ( (a_session ->> '_utime') )",
], ],
}, },
}; };
@ -343,10 +348,11 @@ print <<EOT;
| Backend | Insert 1000 | Get 1 | Purge 500 | Parse all | 1 letter | 1 user | | Backend | Insert 1000 | Get 1 | Purge 500 | Parse all | 1 letter | 1 user |
+-----------------------------------------+-------------------------------------+-----------------------------------+ +-----------------------------------------+-------------------------------------+-----------------------------------+
EOT EOT
for(my $i = 0; $i < @legend; $i+=2) { for ( my $i = 0 ; $i < @legend ; $i += 2 ) {
my $type = $legend[$i+1]; my $type = $legend[ $i + 1 ];
next unless($times->{$type}); next unless ( $times->{$type} );
printf "|%40s |%11.5f | %.5f | %7.4f | %.5f | %.5f | %.5f |\n", $legend[$i], printf "|%40s |%11.5f | %.5f | %7.4f | %.5f | %.5f | %.5f |\n",
$legend[$i],
map { $times->{$type}->{$_} } map { $times->{$type}->{$_} }
qw(insert getSession purge read getLetter getUid); qw(insert getSession purge read getLetter getUid);
} }

Loading…
Cancel
Save