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

FIX: Update quotes after moving posts #8326

Merged
merged 1 commit into from Nov 12, 2019

Conversation

@udan11
Copy link
Member

udan11 commented Nov 8, 2019

No description provided.

@discoursebot

This comment has been minimized.

Copy link

discoursebot commented Nov 8, 2019

You've signed the CLA, udan11. Thank you! This pull request is ready for review.

@discoursebot

This comment has been minimized.

Copy link

discoursebot commented Nov 8, 2019

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/8

Copy link
Member

eviltrout left a comment

This is getting quite sophisticated!

Copy link
Member

gschlager left a comment

Looks good and it should work with a large portion of quotes. 👍 I tested it on a larger database and it seems to be quite fast even though the explain plan doesn't looks that good (probably because of the temp table):

Update on posts p  (cost=141.40..3859.55 rows=1142 width=788)
  ->  Nested Loop  (cost=141.40..3859.55 rows=1142 width=788)
        ->  Hash Join  (cost=141.11..191.63 rows=1142 width=32)
              Hash Cond: (mp.old_post_id = qp.quoted_post_id)
              ->  Seq Scan on moved_posts mp  (cost=0.00..19.70 rows=970 width=26)
              ->  Hash  (cost=82.16..82.16 rows=4716 width=14)
                    ->  Seq Scan on quoted_posts qp  (cost=0.00..82.16 rows=4716 width=14)
        ->  Index Scan using posts_pkey on posts p  (cost=0.29..3.17 rows=1 width=1164)
              Index Cond: (id = qp.post_id)
@udan11 udan11 merged commit bbcce08 into discourse:master Nov 12, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@udan11 udan11 deleted the udan11:fix_quotes_after_move branch Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.