Comments (6)
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.
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.
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.
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.
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.
Ok, with this explanation it makes more sense. Thanks!
from clickhouse.
Related Issues (20)
- Log down the checked privileges to the system.query_log HOT 1
- Freebsd + Mysql compiling error
- Logs are sent over network not instantly. HOT 1
- ClickHouse Zookeeper API automatically optimize `multi` to `mutiRead` HOT 4
- Create BigRedButton script to cancel all the worflows with a given name HOT 2
- CH to Teradata via ODBC
- Issues with persistency in storage `File`/`S3`/… with setting `engine_file_allow_create_multiple_files`
- ThreadSanitizer: data race: DB::TimeoutSetter::~TimeoutSetter() HOT 2
- Segmentation fault DB::StorageDistributed::getOptimizedQueryProcessingStageAnalyzer
- Add settings `local_filesystem_write_method` HOT 1
- Orc logger is incorrect.
- Support new prefetches in `MergeTreeReadPoolParallelReplicas*`
- AST Fuzzer triggered stack overflow for 02896_cyclic_aliases_crash HOT 1
- ClickHouse MySQL protocol does not work with Golang MySQL driver HOT 5
- `Sparse` serialization should be supported for `Nullable` HOT 1
- TSan/MSan builds failures HOT 8
- Got 'TOO LARGE SIZE' when select from odbc table. Is there new settings for this? HOT 4
- the hdfs with kerberos authentication,I has done follow the doc https://clickhouse.com/docs/en/engines/table-engines/integrations/hdfs, get Exception: Unable to connect to hdfs: simple authentication is not enabled. Available:[TOKEN,KERBEROS](NETWORK_ERROR)
- recursive CTE primary key optimization for recursive step HOT 1
- To select a json object from mongodb in clickhouse. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse.