Giter VIP home page Giter VIP logo

Comments (6)

den-crane avatar den-crane commented on May 26, 2024

No such best practice. Each user has own preferences.
Clickhouse works perfectly without using optimize.
Clickhouse has very sophisticated merge planner which has a goal to reduce a number of merges and keep reasonable number parts the same time. This approach allows to save disk and CPU resources for queries.

One of my database has partitions with a final size 100MB, another database has partitions with a final size 15TB. It will be an insane mistake to try to optimize fully in the second case.

Check also min_age_to_force_merge_seconds. But it basically the same as optimize+crond, the same concerns.

from clickhouse.

enzorevo avatar enzorevo commented on May 26, 2024

No such best practice. Each user has own preferences. Clickhouse works perfectly without using optimize. Clickhouse has very sophisticated merge planner which has a goal to reduce a number of merges and keep reasonable number parts the same time. This approach allows to save disk and CPU resources for queries.

One of my database has partitions with a final size 100MB, another database has partitions with a final size 15TB. It will be an insane mistake to try to optimize fully in the second case.

Check also min_age_to_force_merge_seconds. But it basically the same as optimize+crond, the same concerns.

Thanks for the reply. Why you say it would be an insane mistake for the second table to be OPTIMIZEd? In what terms?

note: I’m not referring to OPTIMIZE final, only OPTIMIZE

from clickhouse.

den-crane avatar den-crane commented on May 26, 2024

What does OPTIMIZE do? It calls the unplanned merge.

What the sense to call it? To merge parts to max size (150GB)?
It's a waste of resources to merge 2 parts, one part with size 130GB and another with a size 10KB, if you have more parts with 150GB in the same partition, or just more parts.

from clickhouse.

enzorevo avatar enzorevo commented on May 26, 2024

What is OPTIMIZE does? It calls the unplanned merge.

What the sense to call it? To merge parts to max size (150GB)? It's a waste of resources to merge 2 parts, one part with size 130GB and another with a size 10KB, if you have more parts with 150GB in the same partition, or just more parts.

Ok so the idea is to rely on the result that the automatic merges get normally out, if we have big-size partitions?

from clickhouse.

den-crane avatar den-crane commented on May 26, 2024

Think about OPTIMIZE like it debug/admin command. Basically you should never use it, never need.
I guess it was introduced for Clickhouse CI (for Clickhouse development), to force merges within CI checks.

from clickhouse.

enzorevo avatar enzorevo commented on May 26, 2024

Ok, with this explanation it makes more sense. Thanks!

from clickhouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.