Materialized Views and Projections Under the Hood

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 12

  • @zingsting9595
    @zingsting9595 Рік тому +12

    This should be one of the first videos to be presented to clickhouse noobs as it contains the very basic concept of parts and merges that are not very well introduced in the written documentation. Either update the docs or change the title of the video to intro to clickhouse.

  • @joesligo1516
    @joesligo1516 Рік тому +3

    Extremely helpful video, particularly explaining the concepts on agg mergetrees in theory never merging to a single file. It was very counterintuitive for me at first.

  • @belferman
    @belferman Рік тому +1

    Fantastic explanation, made it very simple. Thanks!

  • @slavabutyrkin
    @slavabutyrkin Рік тому

    Very clear explanation. Thanks!

  • @mayankpant5376
    @mayankpant5376 Рік тому +2

    Projection is great. if you have very defined use-case, it abstracts away all the complexity of materialized view. Will we be able to create separate indexes on projection queries too?

  • @karthikv2k
    @karthikv2k Рік тому +2

    If i create a projection on a table that has data, will the project process both existing and new data to that table or just only new inserts?

    • @ClickHouseDB
      @ClickHouseDB  Рік тому

      Sorry for delay. I will ask and let you know.
      You can also, always, join our Slack to chat in realtime.

    • @ClickHouseDB
      @ClickHouseDB  Рік тому +4

      If you just create the projection (ALTER TABLE ... ADD PROJECTION ...) then only new inserts are processed also by the projection.
      But if you create + materialize (ALTER TABLE ... ADD PROJECTION ... + ALTER TABLE ... MATERIALIZE PROJECTION ...), then also all existing data is transformed.
      You can see an example in this tutorial: clickhouse.com/docs/en/getting-started/example-datasets/uk-price-paid#speedup-with-projections

  • @kokizzu
    @kokizzu Рік тому

    very nice video :3 love this a lot

  • @fille.imgnry
    @fille.imgnry 10 місяців тому

    Great explanations, except that the avg price example in the materialized view is actually showing the sum of the prices. 😮

    • @LukasLalinsky
      @LukasLalinsky 6 місяців тому +2

      It stores the sum and the number of values contributing to the sum. That's the aggregation state. You can get the avg from sum/count.