Skip to content

FR: Expose what triggered the merge in system.part_log #26255

Closed

Description

@SaltTan

It would be great to see what TTL rule triggered a particular merge.
The other reasons are nice to see as well, like an OPTIMIZE statement etc.
Maybe add a row when a merge starts? Like in system.query_log.

Activity

  1. added
    comp-ttl
    on Jul 15, 2021
  2. added
    easy task
    on Jul 15, 2021
  3. MaxWk commented on Jul 15, 2021

    @MaxWk
    Contributor

    please assign it to me

  4. MaxWk commented on Jul 15, 2021

    @MaxWk
    Contributor

    Hi SaltTan,did you mean add merge_type column into part log?

    enum class MergeType
    {
        /// Just regular merge
        REGULAR = 1,
        /// Merge assigned to delete some data from parts (with TTLMergeSelector)
        TTL_DELETE = 2,
        /// Merge with recompression
        TTL_RECOMPRESS = 3,
    };
    
  5. SaltTan commented on Jul 15, 2021

    @SaltTan
    ContributorAuthor

    Hi SaltTan,did you mean add merge_type column into part log?

    Ideally I would like to see something like this:

    COLUMN test_k TTL event_date + toIntervalDay (30)
    TABLE TTL event_date + toIntervalDay (60)
    OPTIMIZE TABLE final
    

    I'm not sure about regular merges, but if it's possible to expose the reason why ClickHouse decided to run this particular merge, that would be interesting to see :)
    However I'll be happy to see MergeType as you are suggesting, it's much better than nothing.

  6. SaltTan commented on Jul 26, 2021

    @SaltTan
    ContributorAuthor

    Another useful thing to see in part_log is MergeAlgorithm

    enum class MergeAlgorithm
    {
        Undecided, /// Not running yet
        Horizontal, /// per-row merge of all columns
        Vertical /// per-row merge of PK and secondary indices columns, per-column gather for non-PK columns
    };
    
  7. MaxWk commented on Jul 29, 2021

    @MaxWk
    Contributor

    Hi SaltTan,did you mean add merge_type column into part log?

    Ideally I would like to see something like this:

    COLUMN test_k TTL event_date + toIntervalDay (30)
    TABLE TTL event_date + toIntervalDay (60)
    OPTIMIZE TABLE final
    

    I'm not sure about regular merges, but if it's possible to expose the reason why ClickHouse decided to run this particular merge, that would be interesting to see :)
    However I'll be happy to see MergeType as you are suggesting, it's much better than nothing.

    I have some questions. At present, there are two ways to trigger Merge, one is the optimize statement, and the other is the background scheduling. it will select three MergeType in method selectPartsToMerge . Therefore, optimize belongs to trigger mode and TTL belongs to MergeType. So what I understand is that you want both the trigger reason and MergeType

  8. SaltTan commented on Jul 29, 2021

    @SaltTan
    ContributorAuthor

    I have some questions. At present, there are two ways to trigger Merge, one is the optimize statement, and the other is the background scheduling. it will select three MergeType in method selectPartsToMerge . Therefore, optimize belongs to trigger mode and TTL belongs to MergeType. So what I understand is that you want both the trigger reason and MergeType

    Yes, and I also want MergeAlgorithm now :)
    Thank you for looking into this.

    enum class MergeAlgorithm
    {
        Undecided, /// Not running yet
        Horizontal, /// per-row merge of all columns
        Vertical /// per-row merge of PK and secondary indices columns, per-column gather for non-PK columns
    };
    
  9. alexey-milovidov commented on Dec 23, 2021

    @alexey-milovidov
    Member

    @MaxWk Are you working on this feature?

  10. self-assigned this
    on May 2, 2022
  11. azat commented on Jul 14, 2022

    @azat
    Member

    Seems that this can be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp-ttleasy taskfeature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions