1
0
Fork 0
mirror of https://git.pleroma.social/pleroma/pleroma.git synced 2025-04-09 12:34:09 +00:00

Merge branch 'speed-improvement' into 'develop'

Migrations: Add activities_actor_type index

See merge request 
This commit is contained in:
lain 2025-03-18 08:33:09 +00:00
commit 7328235c64
3 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1 @@
Add new activity actor/type index. Greatly speeds up retrieval of rare types (like "Listen")

View file

@ -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,

View file

@ -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