mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-24 13:57:23 -04: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
7328235c64
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,
|
config :pleroma, Pleroma.Repo,
|
||||||
telemetry_event: [Pleroma.Repo.Instrumenter],
|
telemetry_event: [Pleroma.Repo.Instrumenter],
|
||||||
migration_lock: nil
|
migration_lock: :pg_advisory_lock
|
||||||
|
|
||||||
config :pleroma, Pleroma.Captcha,
|
config :pleroma, Pleroma.Captcha,
|
||||||
enabled: true,
|
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…
Add table
Add a link
Reference in a new issue