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

Defer Problem.summary on ProblemList #1407

Merged
merged 1 commit into from
Jun 1, 2020
Merged

Conversation

quantum5
Copy link
Member

@quantum5 quantum5 commented Jun 1, 2020

No description provided.

@quantum5 quantum5 merged commit 9b8e3d7 into master Jun 1, 2020
@quantum5 quantum5 deleted the problem-defer-summary branch June 1, 2020 03:05
@Xyene
Copy link
Member

Xyene commented Jun 1, 2020

For future reference, this query is another 50ms faster:

 SELECT `judge_problem`.`id`,
       `judge_problem`.`code`,
       `judge_problem`.`name`,
       `judge_problem`.`group_id`,
       `judge_problem`.`time_limit`,
       `judge_problem`.`memory_limit`,
       `judge_problem`.`short_circuit`,
       `judge_problem`.`points`,
       `judge_problem`.`partial`,
       `judge_problem`.`is_public`,
       `judge_problem`.`is_manually_managed`,
       `judge_problem`.`date`,
       `judge_problem`.`license_id`,
       `judge_problem`.`user_count`,
       `judge_problem`.`ac_rate`,
       `judge_problem`.`is_organization_private`,
       Coalesce(( judge_problemtranslation.name ), `judge_problem`.`name`) AS
       `i18n_name`,
       `judge_problemgroup`.`id`,
       `judge_problemgroup`.`name`,
       `judge_problemgroup`.`full_name`
FROM   `judge_problem`
       JOIN (SELECT DISTINCT `judge_problem`.`id`
             FROM   `judge_problem`
                    LEFT OUTER JOIN `judge_problem_authors`
                                 ON ( `judge_problem`.`id` =
                                      `judge_problem_authors`.`problem_id` )
                    LEFT OUTER JOIN `judge_problem_curators`
                                 ON ( `judge_problem`.`id` =
                                      `judge_problem_curators`.`problem_id` )
                    LEFT OUTER JOIN `judge_problem_testers`
                                 ON ( `judge_problem`.`id` =
                                      `judge_problem_testers`.`problem_id` )
             WHERE  ( `judge_problem`.`is_public` = 1
                       OR `judge_problem_authors`.`profile_id` = 2
                       OR `judge_problem_curators`.`profile_id` = 2
                       OR `judge_problem_testers`.`profile_id` = 2 )
             ORDER  BY `judge_problem`.`code` ASC
             LIMIT  50) top_50
         ON top_50.id = judge_problem.id
       LEFT OUTER JOIN `judge_problemtranslation`
                    ON ( `judge_problem`.`id` =
                         `judge_problemtranslation`.`problem_id`
                         AND ( `judge_problemtranslation`.`language` = 'en' ) )
       INNER JOIN `judge_problemgroup`
               ON ( `judge_problem`.`group_id` = `judge_problemgroup`.`id` );  

fluix-dev pushed a commit to fluix-dev/dmoj-site that referenced this pull request Jun 2, 2020
outloudvi pushed a commit to SchOJ/site that referenced this pull request Oct 27, 2020
malbareda pushed a commit to malbareda/JOEL-web that referenced this pull request Jan 4, 2024
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.

2 participants