Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 136
    • Merge requests 136
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !1574

Merged
Created Mar 10, 2022 by Vincent Pelletier@vpelletierOwner

CMFActivity: simplify dependency query

  • Overview 4
  • Commits 3
  • Changes 1

@Nicolas triggered a validation node SQL error while processing a large number of activities with very varied after_tag dependencies (1.8 distinct after_tag values per activity, which seems to me to be quite an extreme case):

ProgrammingError: (1064, "memory exhausted near [...]")

With the current setup of 3 activity tables, and a limit of 1k activities being checked at a time, this meant there were 5400 UNION-joined subqueries in the total query.

When this situation occurs, it completely blocks all activity validation until human intevention. This error comes from the InnoDB SQL grammar parser (yacc).

Restricting to less than 3k will reduce performance somewhat (by increasing the number of query) because it is very likely for to-validate activities to have at least one dependency (ideally very little above 1 on average) each, so the limit should be somewhere above 3k and below 5.4k. 5k is verified to work for this query structure, so it seems a reasonable limit.

/cc @jm

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: cmfactivity-simplify-dependency-query
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7