Skip to content

[Subtask]: merge sort memory usage  #16653

Closed

Description

@fengttt

Parent Issue

#16617 Case 2 Part 1.

Detail of Subtask

Please inspect if merge sort use 8G of memory is expected. Mergesort should use only same amount of memory as 1 run.

Describe implementation you've considered

No response

Additional information

No response

Activity

  1. added
    severity/s0
    on Jun 5, 2024
  2. w-zr commented on Jun 5, 2024

    @w-zr
    Contributor

    To avoid deletion/update conflicts, it's necessary to preserve the correspondence between each line of the objects before and after the merge. Therefore, the memory consumption during merging is directly proportional to the number of lines in the objects being merged. The following graph shows the memory consumption of the daily regression process for this correspondence yesterday.
    image

  3. assigned and unassigned on Jun 5, 2024
  4. fengttt commented on Jun 17, 2024

    @fengttt
    ContributorAuthor

    This is not OK. As merge sort implementer you must know how much memory you can use, where to get it. A config, or query scheduler. One you have the number, you will sort using this number of memory. Assume it is 8G. You must sort 8G of data in memory and, and spill if data is more than 8G.

  5. assigned and unassigned on Jun 17, 2024
  6. w-zr commented on Jun 23, 2024

    @w-zr
    Contributor

    目前没有进展

  7. w-zr commented on Jun 28, 2024

    @w-zr
    Contributor

    目前没有进展

  8. added this to the 1.3.0 milestone on Jul 1, 2024
  9. w-zr commented on Jul 3, 2024

    @w-zr
    Contributor

    目前没有进展

  10. w-zr commented on Jul 9, 2024

    @w-zr
    Contributor

    目前没有进展

  11. w-zr commented on Jul 15, 2024

    @w-zr
    Contributor

    目前没有进展

  12. w-zr commented on Jul 18, 2024

    @w-zr
    Contributor

    目前正在优化手动merge操作。之后会做一些细节测试,查看内存占用。

  13. w-zr commented on Jul 25, 2024

    @w-zr
    Contributor

    #17656 合并之后,内存有较大提升。

  14. w-zr commented on Jul 30, 2024

    @w-zr
    Contributor

    Memory usage in merging 10M rows:
    Before #17656 :
    image

    After #17656 :
    image

    After #17768:
    image

    After #17768, it will be difficult to achieve significant memory optimization in the merge process.

  15. assigned and unassigned on Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/subtaskseverity/s0

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions