Giter VIP home page Giter VIP logo

Comments (2)

Algunenano avatar Algunenano commented on June 26, 2024

Something is not working as expected. Either the documentation is completely wrong, or the code is completely wrong:

SELECT
    name,
    data_uncompressed_bytes
FROM system.columns
WHERE `table` = 'zookeeper_log'
ORDER BY name ASC

Query id: 11e7eb58-9cfb-4f2f-ab02-54038205b603

    ┌─name──────────────────┬─data_uncompressed_bytes─┐
 1. │ address               │                       0 │
 2. │ children              │                       0 │
 3. │ data                  │                       0 │
 4. │ duration_microseconds │                       0 │
 5. │ error                 │                       0 │
 6. │ event_date            │                       0 │
 7. │ event_time            │                       0 │
 8. │ has_watch             │                       0 │
 9. │ hostname              │                       0 │
10. │ is_ephemeral          │                       0 │
11. │ is_sequential         │                       0 │
12. │ op_num                │                       0 │
13. │ path                  │                       0 │
14. │ path_created          │                       0 │
15. │ port                  │                       0 │
16. │ query_id              │                       0 │
17. │ request_idx           │                       0 │
18. │ requests_size         │                       0 │
19. │ session_id            │                       0 │
20. │ stat_cversion         │                       0 │
21. │ stat_czxid            │                       0 │
22. │ stat_dataLength       │                       0 │
23. │ stat_mzxid            │                       0 │
24. │ stat_numChildren      │                       0 │
25. │ stat_pzxid            │                       0 │
26. │ stat_version          │                       0 │
27. │ thread_id             │                       0 │
28. │ type                  │                       0 │
29. │ version               │                       0 │
30. │ watch_state           │                       0 │
31. │ watch_type            │                       0 │
32. │ xid                   │                       0 │
33. │ zxid                  │                       0 │
    └───────────────────────┴─────────────────────────┘

33 rows in set. Elapsed: 0.005 sec. 

production-01 :) Select column, sum(data_uncompressed_bytes) from system.parts_columns where table = 'zookeeper_log' and active group by column order by column

SELECT
    column,
    sum(data_uncompressed_bytes)
FROM system.parts_columns
WHERE (`table` = 'zookeeper_log') AND active
GROUP BY column
ORDER BY column ASC

Query id: b1faef1b-1dcb-49df-a330-3ad2f226600a

    ┌─column────────────────┬─sum(data_uncompressed_bytes)─┐
 1. │ address               │                      2399315 │
 2. │ children              │                      2399315 │
 3. │ data                  │                      2399315 │
 4. │ duration_microseconds │                      2399315 │
 5. │ error                 │                      2399315 │
 6. │ event_date            │                      2399315 │
 7. │ event_time            │                      2399315 │
 8. │ has_watch             │                      2399315 │
 9. │ hostname              │                      2399315 │
10. │ is_ephemeral          │                      2399315 │
11. │ is_sequential         │                      2399315 │
12. │ op_num                │                      2399315 │
13. │ path                  │                      2399315 │
14. │ path_created          │                      2399315 │
15. │ port                  │                      2399315 │
16. │ query_id              │                      2399315 │
17. │ request_idx           │                      2399315 │
18. │ requests_size         │                      2399315 │
19. │ session_id            │                      2399315 │
20. │ stat_cversion         │                      2399315 │
21. │ stat_czxid            │                      2399315 │
22. │ stat_dataLength       │                      2399315 │
23. │ stat_mzxid            │                      2399315 │
24. │ stat_numChildren      │                      2399315 │
25. │ stat_pzxid            │                      2399315 │
26. │ stat_version          │                      2399315 │
27. │ thread_id             │                      2399315 │
28. │ type                  │                      2399315 │
29. │ version               │                      2399315 │
30. │ watch_state           │                      2399315 │
31. │ watch_type            │                      2399315 │
32. │ xid                   │                      2399315 │
33. │ zxid                  │                      2399315 │
    └───────────────────────┴──────────────────────────────┘

33 rows in set. Elapsed: 0.008 sec. 

from clickhouse.

UnamedRus avatar UnamedRus commented on June 26, 2024

data_uncompressed_bytes is total part size in system.parts_columns

For column data, there are other columns

36. │ column_bytes_on_disk                  │ UInt64             │              │                    │ Total size of the column in bytes.
                                                                 │                  │                │
37. │ column_data_compressed_bytes          │ UInt64             │              │                    │ Total size of the compressed data in the column, in bytes.
                                                                 │                  │                │
38. │ column_data_uncompressed_bytes        │ UInt64             │              │                    │ Total size of the decompressed data in the column, in bytes.
                                                                 │                  │                │

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.