diff --git a/app/helpers/pg_hero/home_helper.rb b/app/helpers/pg_hero/home_helper.rb index 6caa2d4c4..afb40aedd 100644 --- a/app/helpers/pg_hero/home_helper.rb +++ b/app/helpers/pg_hero/home_helper.rb @@ -16,6 +16,15 @@ def pghero_js_value(value) json_escape(value.to_json(root: false)).html_safe end + def pghero_drop_idx_concurrently_explanation + if @database.drop_idx_concurrently_supported? + ret = "

Tip: Use CONCURRENTLY for DROP INDEX

" + ret << "" + ret.html_safe + end + end + def pghero_remove_index(query) if query[:columns] columns = query[:columns].map(&:to_sym) @@ -24,6 +33,7 @@ def pghero_remove_index(query) ret = String.new("remove_index #{query[:table].to_sym.inspect}") ret << ", name: #{(query[:name] || query[:index]).to_s.inspect}" ret << ", column: #{columns.inspect}" if columns + ret << ", algorithm: concurrently" if @database.drop_idx_concurrently_supported? ret end diff --git a/app/views/pg_hero/home/index.html.erb b/app/views/pg_hero/home/index.html.erb index dfb80ef11..7e7001aec 100644 --- a/app/views/pg_hero/home/index.html.erb +++ b/app/views/pg_hero/home/index.html.erb @@ -391,6 +391,10 @@ diff --git a/app/views/pg_hero/home/space.html.erb b/app/views/pg_hero/home/space.html.erb index 0376b291b..c74fbe9ab 100644 --- a/app/views/pg_hero/home/space.html.erb +++ b/app/views/pg_hero/home/space.html.erb @@ -31,6 +31,9 @@