doris04 自定義建表

2022-05-06 15:03:14 字數 922 閱讀 1856

目錄doris建表時, 如果是大寬表, 即所有欄位都在一條記錄中, 效能會非常差. 所以建議將常更新的維度資料使用star schema區分維度表和事實表.

頻繁更新的維度表也可以放在 mysql 外部表中。而如果只有少量更新, 可以直接放在 doris 中。在 doris 中儲存維度表時,可對維度表設定更多的副本,提公升 join 的效能。

doris中schema change有3種方式:

sorted schema change,direct schema change, linked schema change

doris中目前進行 schema change 的方式有三種:sorted schema change,direct schema change, linked schema change。

sorted schema change

改變了列的排序方式,需對資料進行重新排序。例如刪除排序列中的一列, 欄位重排序。

alter table site_visit drop column city;

direct schema change: 無需重新排序,但是需要對資料做一次轉換。例如修改列的型別,在稀疏索引中加一列等。

alter table site_visit modify column username varchar(64);

linked schema change: 無需轉換資料,直接完成。例如加列操作。

alter table site_visit add column click bigint sum default '0';

建表時建議考慮好 schema,這樣在進行 schema change 時可以加快速度。

自定義鍊錶

鍊錶是非連續 無順序的資料結構,鍊錶中元素與元素之間的記憶體位址沒有順序關係。鍊錶由乙個個結點組成,結點中儲存兩類資訊,第一類是儲存入結點的資料,第二類是結點的指向。鍊錶分為單項鍊表,雙向鍊錶,環形鍊錶,單項鍊表中只有乙個結點指向,指向的的下乙個結點的記憶體位址,只能單向移動,單項操作 雙向鍊錶有兩...

自定義鍊錶

author qcg version 2019 5 6.description 自定義鍊錶 頭尾部的兩步操作 1.插入節點 next指向node 2.變更節點 last指標後移 node.next insertnode 這是插入元素的操作 public class mylinkedlist node...

自定義鍊錶

大多數人使用鍊錶都是看了一遍懵懵懂懂的,想要真正學習的人建議潛下心來自定義乙個鍊錶試試,自己搭建高樓大廈和看別人搭建是兩碼事,在自定義的過程中會明白自己建立的美妙感覺 public class node public node node privious,node next,object eleme...