}
if self.saved_only.unwrap_or(false) {
- query = query.filter(comment_saved::id.is_not_null());
+ query = query.filter(comment_saved::comment_id.is_not_null());
}
if !self.show_deleted_and_removed.unwrap_or(true) {
if self.local_user.is_some() {
// Filter out the rows with missing languages
- query = query.filter(local_user_language::id.is_not_null());
+ query = query.filter(local_user_language::language_id.is_not_null());
// Don't show blocked communities or persons
query = query.filter(community_block::person_id.is_null());
};
if self.saved_only.unwrap_or(false) {
- query = query.filter(post_saved::id.is_not_null());
+ query = query.filter(post_saved::post_id.is_not_null());
}
// Only hide the read posts, if the saved_only is false. Otherwise ppl with the hide_read
// setting wont be able to see saved posts.
else if !self.local_user.map(|l| l.show_read_posts).unwrap_or(true) {
- query = query.filter(post_read::id.is_null());
+ query = query.filter(post_read::post_id.is_null());
}
if self.local_user.is_some() {
// Filter out the rows with missing languages
- query = query.filter(local_user_language::id.is_not_null());
+ query = query.filter(local_user_language::language_id.is_not_null());
// Don't show blocked communities or persons
query = query.filter(community_block::person_id.is_null());
"postgres",
"-c", "session_preload_libraries=auto_explain",
"-c", "auto_explain.log_min_duration=5ms",
- "-c", "auto_explain.log_analyze=true"
+ "-c", "auto_explain.log_analyze=true",
+ "-c", "track_activity_query_size=1048576"
]
networks:
- lemmyinternal
--- /dev/null
+drop index idx_post_saved_person_id, idx_comment_saved_person_id;
--- /dev/null
+create index idx_post_saved_person_id on post_saved (person_id);
+create index idx_comment_saved_person_id on comment_saved (person_id);