Skip to content
Snippets Groups Projects
Commit a84e1bd3 authored by Marcin's avatar Marcin Committed by Dan Notestein
Browse files

issue#252: analyze start in each creation index thread

Instead of running analyze in a separated transaction after all indexes
are created, now each table is analyzed in the the same transaction
as indexes are created. This way app got informed about 'HAF is ready'
when both indes is created and analyze finished
parent 9820b073
No related branches found
No related tags found
6 merge requests!627merge in fix for get_current_block_age,!626Fix get_current_block_age function to avoid healthcheck fails,!622merge develop to master,!599merge ( with merge commit) develop to master,!597Merge develop to master for release,!548issue#252: analyze start in each creation index thread
Checking pipeline status
...@@ -530,6 +530,8 @@ BEGIN ...@@ -530,6 +530,8 @@ BEGIN
END LOOP; END LOOP;
CLOSE __cursor; CLOSE __cursor;
EXECUTE format( 'ANALYZE %s', _table_name );
DELETE FROM hive.indexes_constraints DELETE FROM hive.indexes_constraints
WHERE table_name = _table_name AND is_foreign_key = FALSE; WHERE table_name = _table_name AND is_foreign_key = FALSE;
RAISE NOTICE 'Finished restoring any dropped indexes on %', _table_name; RAISE NOTICE 'Finished restoring any dropped indexes on %', _table_name;
......
...@@ -94,10 +94,6 @@ indexes_controler::enable_indexes() { ...@@ -94,10 +94,6 @@ indexes_controler::enable_indexes() {
*restore_applied_hardforks_idxs *restore_applied_hardforks_idxs
); );
auto analyze_expression_idxs = start_commit_sql( true, "hive.reanalyze_indexes_with_expressions()", "enable indexes" );
analyze_expression_idxs->join();
fc::time_point cluster_start_time = fc::time_point::now(); fc::time_point cluster_start_time = fc::time_point::now();
fc::microseconds restore_indexes_time = cluster_start_time - restore_indexes_start_time; fc::microseconds restore_indexes_time = cluster_start_time - restore_indexes_start_time;
ilog( "PROFILE: Restored HAF table indexes: ${t}s", ("t",restore_indexes_time.to_seconds()) ); ilog( "PROFILE: Restored HAF table indexes: ${t}s", ("t",restore_indexes_time.to_seconds()) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment