Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Tryton Tryton
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 796
    • Issues 796
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 94
    • Merge requests 94
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Tryton
  • TrytonTryton
  • Issues
  • #11486
Closed
Open
Created May 13, 2022 by Cédric Krier@cedOwner

Use implicit join for where clause on Many2One

The subquery in the form of column IN (SELECT id FROM ...) can be very slow because they are often SubPlan. This means that they are evaluated for each row. So this has a complexity of O(n^2). But as we do that only on id which is the primary key we could limit the subquery to fetch only one id per row using a clause like: column IN (SELECT id FROM ... WHERE ... AND id = column). The complexity thanks to the index becomes O(n log(n)).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking