mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 05:57:54 +00:00
sql --dbsize will now list sizes of all databases if given no database.
This commit is contained in:
parent
463ec5bc0b
commit
afbbc30ce6
34
NEWS
34
NEWS
|
@ -1,3 +1,37 @@
|
||||||
|
20120422
|
||||||
|
|
||||||
|
* A race condition bug caused restructuring of a central piece of the
|
||||||
|
code. Thus this release of GNU Parallel should be considered beta
|
||||||
|
quality.
|
||||||
|
|
||||||
|
* sql --dbsize will now list sizes of all databases if given no
|
||||||
|
database.
|
||||||
|
|
||||||
|
* Article: Computational and experimental analyses of
|
||||||
|
retrotransposon-associated minisatellite DNAs in the soybean genome.
|
||||||
|
http://www.biomedcentral.com/content/supplementary/1471-2105-13-s2-s13-s1.pdf
|
||||||
|
|
||||||
|
* Blog post: GNU parallel - the best thing since sliced bread.
|
||||||
|
https://arrayal.wordpress.com/2012/03/27/gnu-parallel-the-best-thing-since-sliced-bread/
|
||||||
|
|
||||||
|
* Blog post: GNU Parallel makes everything faster.
|
||||||
|
http://compbiously.blogspot.com/2012/03/gnu-parallel-makes-everything-faster.html
|
||||||
|
|
||||||
|
* Blog post (German): Howto: GNU parallel.
|
||||||
|
http://d24m.de/2012/04/05/howto-gnu-parallel/
|
||||||
|
|
||||||
|
* Blog post: Running in Parallel
|
||||||
|
http://interactivity.ifactory.com/2012/04/running-in-parallel/
|
||||||
|
|
||||||
|
* 20000 watched the first intro video.
|
||||||
|
http://pi.dk/1
|
||||||
|
|
||||||
|
* The first 5 have received their GNU Parallel merchandise
|
||||||
|
https://www.gnu.org/software/parallel/merchandise.html
|
||||||
|
|
||||||
|
* Bug fixes and man page updates.
|
||||||
|
|
||||||
|
|
||||||
20120322
|
20120322
|
||||||
|
|
||||||
* Parallel Process Database Dumps.
|
* Parallel Process Database Dumps.
|
||||||
|
|
|
@ -171,16 +171,20 @@ cc:Sandro Cazzaniga <kharec@mandriva.org>,
|
||||||
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>,
|
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>,
|
||||||
Jesse Alama <jesse.alama@gmail.com>
|
Jesse Alama <jesse.alama@gmail.com>
|
||||||
|
|
||||||
Subject: GNU Parallel 20120422 ('') released
|
Subject: GNU Parallel 20120422 ('Mærsk') released
|
||||||
|
|
||||||
GNU Parallel 20120422 ('') has been released. It is
|
GNU Parallel 20120422 ('Mærsk') has been released. It is
|
||||||
available for download at: http://ftp.gnu.org/gnu/parallel/
|
available for download at: http://ftp.gnu.org/gnu/parallel/
|
||||||
|
|
||||||
This is a bugfix release with no new features. Probably a good release
|
|
||||||
for stable long-term use.
|
|
||||||
|
|
||||||
New in this release:
|
New in this release:
|
||||||
|
|
||||||
|
* A race condition bug caused restructuring of a central piece of the
|
||||||
|
code. Thus this release of GNU Parallel should be considered beta
|
||||||
|
quality.
|
||||||
|
|
||||||
|
* sql --dbsize will now list sizes of all databases if given no
|
||||||
|
database.
|
||||||
|
|
||||||
* Article: Computational and experimental analyses of
|
* Article: Computational and experimental analyses of
|
||||||
retrotransposon-associated minisatellite DNAs in the soybean genome.
|
retrotransposon-associated minisatellite DNAs in the soybean genome.
|
||||||
http://www.biomedcentral.com/content/supplementary/1471-2105-13-s2-s13-s1.pdf
|
http://www.biomedcentral.com/content/supplementary/1471-2105-13-s2-s13-s1.pdf
|
||||||
|
@ -197,6 +201,12 @@ New in this release:
|
||||||
* Blog post: Running in Parallel
|
* Blog post: Running in Parallel
|
||||||
http://interactivity.ifactory.com/2012/04/running-in-parallel/
|
http://interactivity.ifactory.com/2012/04/running-in-parallel/
|
||||||
|
|
||||||
|
* 20000 watched the first intro video.
|
||||||
|
http://pi.dk/1
|
||||||
|
|
||||||
|
* The first 5 have received their GNU Parallel merchandise
|
||||||
|
https://www.gnu.org/software/parallel/merchandise.html
|
||||||
|
|
||||||
* Bug fixes and man page updates.
|
* Bug fixes and man page updates.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1334,9 +1334,9 @@ Use B<-v> B<-v> to print the wrapping ssh command when running remotely.
|
||||||
Print the version GNU B<parallel> and exit.
|
Print the version GNU B<parallel> and exit.
|
||||||
|
|
||||||
|
|
||||||
=item B<--workdir> I<mydir> (beta testing)
|
=item B<--workdir> I<mydir>
|
||||||
|
|
||||||
=item B<--wd> I<mydir> (beta testing)
|
=item B<--wd> I<mydir>
|
||||||
|
|
||||||
Files transferred using B<--transfer> and B<--return> will be relative
|
Files transferred using B<--transfer> and B<--return> will be relative
|
||||||
to I<mydir> on remote computers, and the command will be executed in
|
to I<mydir> on remote computers, and the command will be executed in
|
||||||
|
|
58
src/sql
58
src/sql
|
@ -815,22 +815,45 @@ sub dblist {
|
||||||
sub dbsize {
|
sub dbsize {
|
||||||
my $dbdriver = shift;
|
my $dbdriver = shift;
|
||||||
my %dburl = @_;
|
my %dburl = @_;
|
||||||
my %statement =
|
my %statement;
|
||||||
("mysql" => (
|
if(defined $dburl{'database'}) {
|
||||||
'SELECT '.
|
%statement =
|
||||||
' table_schema "Data Base Name", '.
|
("mysql" => (
|
||||||
' SUM(data_length+index_length)/1024/1024 "Data Base Size in MB" '.
|
'SELECT '.
|
||||||
'FROM information_schema.TABLES '.
|
' table_schema "database", '.
|
||||||
'GROUP BY table_schema;'),
|
' SUM(data_length+index_length) "bytes", '.
|
||||||
"postgresql" => (
|
' SUM(data_length+index_length)/1024/1024 "megabytes" '.
|
||||||
"SELECT ".
|
'FROM information_schema.TABLES '.
|
||||||
" pg_database_size('".$dburl{'database'}."') AS bytes,".
|
"WHERE table_schema = '$dburl{'database'}'".
|
||||||
" pg_size_pretty(pg_database_size('".$dburl{'database'}."')) AS human_readable;"),
|
'GROUP BY table_schema;'),
|
||||||
"sqlite" => (
|
"postgresql" => (
|
||||||
"SELECT ".(undef_as_zero(-s $dburl{'database'}))." AS bytes;"),
|
"SELECT '$dburl{'database'}' AS database, ".
|
||||||
"sqlite3" => (
|
"pg_database_size('$dburl{'database'}') AS bytes, ".
|
||||||
"SELECT ".(undef_as_zero(-s $dburl{'database'}))." AS bytes;"),
|
"pg_size_pretty(pg_database_size('$dburl{'database'}')) AS human_readabable "),
|
||||||
);
|
"sqlite" => (
|
||||||
|
"SELECT ".(undef_as_zero(-s $dburl{'database'}))." AS bytes;"),
|
||||||
|
"sqlite3" => (
|
||||||
|
"SELECT ".(undef_as_zero(-s $dburl{'database'}))." AS bytes;"),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
%statement =
|
||||||
|
("mysql" => (
|
||||||
|
'SELECT '.
|
||||||
|
' table_schema "database", '.
|
||||||
|
' SUM(data_length+index_length) "bytes", '.
|
||||||
|
' SUM(data_length+index_length)/1024/1024 "megabytes" '.
|
||||||
|
'FROM information_schema.TABLES '.
|
||||||
|
'GROUP BY table_schema;'),
|
||||||
|
"postgresql" => (
|
||||||
|
'SELECT datname AS database, pg_database_size(datname) AS bytes, '.
|
||||||
|
'pg_size_pretty(pg_database_size(datname)) AS human_readabable '.
|
||||||
|
'FROM (SELECT datname FROM pg_database) a;'),
|
||||||
|
"sqlite" => (
|
||||||
|
"SELECT 0 AS bytes;"),
|
||||||
|
"sqlite3" => (
|
||||||
|
"SELECT 0 AS bytes;"),
|
||||||
|
);
|
||||||
|
}
|
||||||
if($statement{$dbdriver}) {
|
if($statement{$dbdriver}) {
|
||||||
return $statement{$dbdriver};
|
return $statement{$dbdriver};
|
||||||
} else {
|
} else {
|
||||||
|
@ -840,7 +863,7 @@ sub dbsize {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Return the code for 'show database size' in the chosen database dialect
|
# Return the code for 'show table size' in the chosen database dialect
|
||||||
sub tablesize {
|
sub tablesize {
|
||||||
my $dbdriver = shift;
|
my $dbdriver = shift;
|
||||||
my $database = shift;
|
my $database = shift;
|
||||||
|
@ -1070,5 +1093,4 @@ sub debug {
|
||||||
print @_;
|
print @_;
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO --list-databases: psql -l eller '\l'. mysql show databases. Oracle ?
|
|
||||||
$::opt_skip_first_line = $::opt_shebang = 0;
|
$::opt_skip_first_line = $::opt_shebang = 0;
|
||||||
|
|
Loading…
Reference in a new issue