mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-09 20:44:08 +00:00
Merge branch 'speed-improvement' into 'develop'
Migrations: Add activities_actor_type index See merge request pleroma/pleroma!4341
This commit is contained in:
commit
bbe81752dd
3 changed files with 16 additions and 1 deletions
1
changelog.d/activity_type_index.change
Normal file
1
changelog.d/activity_type_index.change
Normal file
|
@ -0,0 +1 @@
|
|||
Add new activity actor/type index. Greatly speeds up retrieval of rare types (like "Listen")
|
|
@ -48,7 +48,7 @@ config :pleroma, ecto_repos: [Pleroma.Repo]
|
|||
|
||||
config :pleroma, Pleroma.Repo,
|
||||
telemetry_event: [Pleroma.Repo.Instrumenter],
|
||||
migration_lock: nil
|
||||
migration_lock: :pg_advisory_lock
|
||||
|
||||
config :pleroma, Pleroma.Captcha,
|
||||
enabled: true,
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddActivitiesActorTypeIndex do
|
||||
use Ecto.Migration
|
||||
@disable_ddl_transaction true
|
||||
|
||||
def change do
|
||||
create(
|
||||
index(
|
||||
:activities,
|
||||
["actor", "(data ->> 'type'::text)", "id DESC NULLS LAST"],
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue