Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
b35ff8f7
Commit
b35ff8f7
authored
Oct 23, 2017
by
Roger Braun
Browse files
Use index in basic activity query.
parent
9f417fd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/activity.ex
View file @
b35ff8f7
...
...
@@ -38,7 +38,7 @@ def all_by_object_ap_id(ap_id) do
def
get_create_activity_by_object_ap_id
(
ap_id
)
do
Repo
.
one
(
from
activity
in
Activity
,
where:
fragment
(
"(?)->'object'->>'id'
= ?"
,
activity
.
data
,
^
to_string
(
ap_id
))
and
fragment
(
"(?)->>'type' = 'Create'"
,
activity
.
data
))
where:
fragment
(
"
coalesce(
(?)->'object'->>'id'
, (?)->>'object') = ?"
,
activity
.
data
,
activity
.
data
,
^
to_string
(
ap_id
))
,
where:
fragment
(
"(?)->>'type' = 'Create'"
,
activity
.
data
))
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment