stats DB for monitor #99

Merged
claudio.atzori merged 15 commits from :master into master 2021-03-03 10:29:09 +01:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit a445c1ac3d - Show all commits

View File

@ -19,6 +19,6 @@ cat step21-createMonitorDB.sql | sed s/SOURCE/$1/g | sed s/TARGET/$2/g1 | impala
echo "Impala shell finished" echo "Impala shell finished"
echo "Updating shadow monitor database" echo "Updating shadow monitor database"
impala-shell -d $3 -q "show tables" --delimited | sed 's/^/drop view if exists $3./' | sed 's/$/;/' | impala-shell -f - impala-shell -d $SHADOW -q "show tables" --delimited | sed 's/^/drop view if exists $SHADOW./' | sed 's/$/;/' | impala-shell -f -
impala-shell -d $2 -q "show tables" --delimited | sed 's/\(.*\)/create view $3.\1 as select * from $2.\1;/' | impala-shell -f - impala-shell -d $TARGET -q "show tables" --delimited | sed 's/\(.*\)/create view $SHADOW.\1 as select * from $TARGET.\1;/' | impala-shell -f -
echo "Shadow db ready!" echo "Shadow db ready!"

View File

@ -29,7 +29,7 @@ select rcount.pid, sum(case when rcount.type='publication' then rcount.count els
from rcount from rcount
group by rcount.pid; group by rcount.pid;
create view ${stats_db_name}.rndexpenditure as select * from stats_ext.rndexpediture create view ${stats_db_name}.rndexpenditure as select * from stats_ext.rndexpediture;
ANALYZE TABLE ${stats_db_name}.result_projectcount COMPUTE STATISTICS; ANALYZE TABLE ${stats_db_name}.result_projectcount COMPUTE STATISTICS;
ANALYZE TABLE ${stats_db_name}.result_projectcount COMPUTE STATISTICS FOR COLUMNS; ANALYZE TABLE ${stats_db_name}.result_projectcount COMPUTE STATISTICS FOR COLUMNS;