mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
PERF: optimize translation progress dashboard with batch query (#34861)
Replace individual per-locale queries with a single query that calculates completion progress for all locales at once. This commit also removes methods off the `base_candidate` (used for Categories and Topics as well) which are not used any more, as the progress dashboard only shows progress for posts. t/162846/4 --------- Co-authored-by: Nat <natalie.tay@discourse.org>
This commit is contained in:
co-authored by
Nat
parent
4bc7abbb04
commit
a40149bd1b
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
class AddIndexToPostsLocale < ActiveRecord::Migration[8.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
remove_index :posts, :locale, algorithm: :concurrently, if_exists: true
|
||||
add_index :posts, :locale, algorithm: :concurrently
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :posts, :locale, algorithm: :concurrently, if_exists: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user