Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make faster ProcessFeedService #3080

Merged
merged 2 commits into from May 16, 2017

Conversation

harukasan
Copy link
Contributor

In our slow queries I found:

SELECT "accounts".* FROM "accounts" WHERE "accounts"."uri" = '...' LIMIT 1;

and the query plan is:

paon=> EXPLAIN ANALYZE SELECT "accounts".* FROM "accounts" WHERE "accounts"."uri" = '...' LIMIT 1;
 Limit  (cost=0.00..7710.39 rows=1 width=899) (actual time=202.203..202.203 rows=0 loops=1)
   ->  Seq Scan on accounts  (cost=0.00..46262.32 rows=6 width=899) (actual time=202.201..202.201 rows=0 loops=1)
         Filter: ((uri)::text = '...'::text)
         Rows Removed by Filter: 297178
 Planning time: 1.129 ms
 Execution time: 202.238 ms
(6 rows)

It is due to "accounts"."uri" have no index.

@harukasan harukasan changed the title Add index accounts on uri. Make faster ProcessFeedService. May 16, 2017
@harukasan harukasan changed the title Make faster ProcessFeedService. Make faster ProcessFeedService May 16, 2017
add_index :accounts, :uri
end
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove blank line

@Gargron Gargron merged commit 0dfffb6 into mastodon:master May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants