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

Speed up public stream and remove obsolete indexes #7944

Closed
wants to merge 1 commit into from

Conversation

CSammy
Copy link
Contributor

@CSammy CSammy commented Dec 28, 2018

Speeds up the public stream by a factor of 1000 on a production PostgreSQL database, it's lightning fast now. MySQL shows improvement as well.

@SuperTux88 SuperTux88 added this to the 0.7.9.0 milestone Dec 28, 2018
@goobertron
Copy link

Whaouh – I can't test this, but this could be BIG. Sharing some love for this.

Copy link
Member

@SuperTux88 SuperTux88 left a comment

Choose a reason for hiding this comment

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

Looks good to me, also improves MySQL performance by a factor of 10 on an old export of my prod DB on my dev-pod. Thanks for the analysis 🍪 Migration took around 15s on my dev-pod with MySQL, so should be OK for a minor release.

@SuperTux88
Copy link
Member

Merged as a21cde4

Thanks again @CSammy 🍪

@goobertron you can now test the speed of it on the HQ-pod :)

@Flaburgan
Copy link
Member

\o/ Now, to the user stream! 😛

@goobertron
Copy link

@goobertron you can now test the speed of it on the HQ-pod :)

I also haven't noticed a dramatic improvement on the HQ pod. From manual timing of how long the 'spinning wheel' is present, it's 7 seconds on the /public stream versus 9 seconds on the main /stream.

@koehn
Copy link

koehn commented Dec 30, 2018

Ahh, I thought this was about the /stream query based on a conversation online. My bad; disregard my earlier comments.

@koehn
Copy link

koehn commented Dec 30, 2018

Looking into the explain of the stream query, it's doing a full table scan on posts because created_at is a timestamp without time zone. Is there any reason we don't have a time zone on these columns?

@denschub denschub mentioned this pull request Jan 1, 2019
Copy link

@Stivovo Stivovo left a comment

Choose a reason for hiding this comment

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

/db/migrate/20181227235201_clean_up_posts_indexes.rb

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.

6 participants