Details

    • Type: Improvement Improvement
    • Status: New New
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Near Future
    • Fix Version/s: None
    • Component/s: OIOIOI
    • Labels:
      None

      Description

      Affected changes:
      https://gerrit.sio2project.mimuw.edu.pl/#/c/3505/
      https://gerrit.sio2project.mimuw.edu.pl/#/c/3515/

      Problem:
      The database query is too heavy.

      TODO:
      Optimize the database query.

      Description:

      As for now user contests will be visible for all registered users.
      This is something we don't want. (The user contests should be visible only to people who visited them before)

      The changes above aim to resolve this issue. But there is a side effect.
      In the first change there is a query that is not optimized by django:
       "return Q(contestview__user=request.user)"

      This results in a very heavy query that needs to be improved before it can be submitted to master.

        Activity

        Hide
        Szymon Acedański added a comment - - edited
        Well, this is unfotrunate that the database optimiser (Postgres on szkopul.edu.pl) is not powerful enough to efficiently run this query, which otherwise is a correct query. Probably this needs to be refactored in a semantically equivalent query, but easier to optimize. Or maybe we are missing some index, which I doubt.

        That's a nice task for someone who would like to dive deeply into this query and really dig into what the database/Django did with it.
        Show
        Szymon Acedański added a comment - - edited Well, this is unfotrunate that the database optimiser (Postgres on szkopul.edu.pl) is not powerful enough to efficiently run this query, which otherwise is a correct query. Probably this needs to be refactored in a semantically equivalent query, but easier to optimize. Or maybe we are missing some index, which I doubt. That's a nice task for someone who would like to dive deeply into this query and really dig into what the database/Django did with it.

          People

          • Assignee:
            Unassigned
            Reporter:
            Cezary Chodun
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: