LOB chunk size occupy column schema field and table column id at master
This commit is contained in:
parent
c03c94c4c0
commit
8d1edcadda
4
deps/oblib/src/lib/ob_define.h
vendored
4
deps/oblib/src/lib/ob_define.h
vendored
@ -1726,6 +1726,10 @@ const int64_t OB_MAX_LONGTEXT_LENGTH = 512 * 1024 * 1024L - 1; // 2^29-1,for dat
|
||||
const int64_t OB_MAX_MEDIUMTEXT_LENGTH_OLD = 256 * 1024L; // for compatibility
|
||||
const int64_t OB_MAX_LONGTEXT_LENGTH_OLD = 512 * 1024L; // for compatibility
|
||||
|
||||
const int64_t OB_MIN_LOB_CHUNK_SIZE = 1024; // 1K
|
||||
const int64_t OB_MAX_LOB_CHUNK_SIZE = 256 * 1024; // 256K
|
||||
const int64_t OB_DEFAULT_LOB_CHUNK_SIZE = OB_MAX_LOB_CHUNK_SIZE;
|
||||
|
||||
const int64_t OB_MIN_LOB_INROW_THRESHOLD = 0; // 0 means disable inrow lob
|
||||
const int64_t OB_MAX_LOB_INROW_THRESHOLD = OB_MAX_USER_ROW_LENGTH; // 1.5M
|
||||
const int64_t OB_DEFAULT_LOB_INROW_THRESHOLD = 4096; // 4K
|
||||
|
@ -7339,6 +7339,25 @@ int ObInnerTableSchema::all_column_history_schema(ObTableSchema &table_schema)
|
||||
skip_index_attr_default,
|
||||
skip_index_attr_default); //default_value
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj lob_chunk_size_default;
|
||||
lob_chunk_size_default.set_int(OB_DEFAULT_LOB_CHUNK_SIZE);
|
||||
ADD_COLUMN_SCHEMA_T("lob_chunk_size", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
true, //is_nullable
|
||||
false, //is_autoincrement
|
||||
lob_chunk_size_default,
|
||||
lob_chunk_size_default); //default_value
|
||||
}
|
||||
table_schema.set_index_using_type(USING_BTREE);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -14624,6 +14624,25 @@ int ObInnerTableSchema::all_virtual_core_column_table_schema(ObTableSchema &tabl
|
||||
skip_index_attr_default,
|
||||
skip_index_attr_default); //default_value
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj lob_chunk_size_default;
|
||||
lob_chunk_size_default.set_int(OB_DEFAULT_LOB_CHUNK_SIZE);
|
||||
ADD_COLUMN_SCHEMA_T("lob_chunk_size", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false, //is_autoincrement
|
||||
lob_chunk_size_default,
|
||||
lob_chunk_size_default); //default_value
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -8612,6 +8612,25 @@ int ObInnerTableSchema::all_virtual_column_schema(ObTableSchema &table_schema)
|
||||
skip_index_attr_default,
|
||||
skip_index_attr_default); //default_value
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj lob_chunk_size_default;
|
||||
lob_chunk_size_default.set_int(OB_DEFAULT_LOB_CHUNK_SIZE);
|
||||
ADD_COLUMN_SCHEMA_T("lob_chunk_size", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false, //is_autoincrement
|
||||
lob_chunk_size_default,
|
||||
lob_chunk_size_default); //default_value
|
||||
}
|
||||
table_schema.set_index_using_type(USING_BTREE);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
@ -9204,6 +9223,25 @@ int ObInnerTableSchema::all_virtual_column_history_schema(ObTableSchema &table_s
|
||||
skip_index_attr_default,
|
||||
skip_index_attr_default); //default_value
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj lob_chunk_size_default;
|
||||
lob_chunk_size_default.set_int(OB_DEFAULT_LOB_CHUNK_SIZE);
|
||||
ADD_COLUMN_SCHEMA_T("lob_chunk_size", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
true, //is_nullable
|
||||
false, //is_autoincrement
|
||||
lob_chunk_size_default,
|
||||
lob_chunk_size_default); //default_value
|
||||
}
|
||||
table_schema.set_index_using_type(USING_BTREE);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -6937,6 +6937,21 @@ int ObInnerTableSchema::all_virtual_column_real_agent_ora_schema(ObTableSchema &
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("LOB_CHUNK_SIZE", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObNumberType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
38, //column_length
|
||||
38, //column_precision
|
||||
0, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("GMT_CREATE", //column_name
|
||||
++column_id, //column_id
|
||||
|
@ -6780,6 +6780,21 @@ int ObInnerTableSchema::all_virtual_core_column_table_ora_schema(ObTableSchema &
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ADD_COLUMN_SCHEMA("LOB_CHUNK_SIZE", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObNumberType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
38, //column_length
|
||||
38, //column_precision
|
||||
0, //column_scale
|
||||
false, //is_nullable
|
||||
false); //is_autoincrement
|
||||
}
|
||||
table_schema.set_index_using_type(USING_HASH);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -2218,6 +2218,25 @@ int ObInnerTableSchema::all_column_schema(ObTableSchema &table_schema)
|
||||
skip_index_attr_default,
|
||||
skip_index_attr_default); //default_value
|
||||
}
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
ObObj lob_chunk_size_default;
|
||||
lob_chunk_size_default.set_int(OB_DEFAULT_LOB_CHUNK_SIZE);
|
||||
ADD_COLUMN_SCHEMA_T("lob_chunk_size", //column_name
|
||||
++column_id, //column_id
|
||||
0, //rowkey_id
|
||||
0, //index_id
|
||||
0, //part_key_pos
|
||||
ObIntType, //column_type
|
||||
CS_TYPE_INVALID, //column_collation_type
|
||||
sizeof(int64_t), //column_length
|
||||
-1, //column_precision
|
||||
-1, //column_scale
|
||||
false, //is_nullable
|
||||
false, //is_autoincrement
|
||||
lob_chunk_size_default,
|
||||
lob_chunk_size_default); //default_value
|
||||
}
|
||||
table_schema.set_index_using_type(USING_BTREE);
|
||||
table_schema.set_row_store_type(ENCODING_ROW_STORE);
|
||||
table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL);
|
||||
|
@ -326,6 +326,7 @@ all_column_def = dict(
|
||||
('udt_set_id', 'int', 'false', '0'),
|
||||
('sub_data_type', 'int', 'false', '0'),
|
||||
('skip_index_attr', 'int', 'false', '0'),
|
||||
('lob_chunk_size', 'int', 'false', 'OB_DEFAULT_LOB_CHUNK_SIZE'),
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -145,6 +145,7 @@ ObColumnSchemaV2 &ObColumnSchemaV2::operator =(const ObColumnSchemaV2 &src_schem
|
||||
udt_set_id_ = src_schema.udt_set_id_;
|
||||
sub_type_ = src_schema.sub_type_;
|
||||
skip_index_attr_ = src_schema.skip_index_attr_;
|
||||
lob_chunk_size_ = src_schema.lob_chunk_size_;
|
||||
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(deep_copy_obj(src_schema.orig_default_value_, orig_default_value_))) {
|
||||
@ -265,6 +266,7 @@ void ObColumnSchemaV2::reset()
|
||||
sub_type_ = 0;
|
||||
reset_string_array(extended_type_info_);
|
||||
skip_index_attr_.reset();
|
||||
lob_chunk_size_ = OB_DEFAULT_LOB_CHUNK_SIZE;
|
||||
ObSchema::reset();
|
||||
}
|
||||
|
||||
@ -314,7 +316,8 @@ OB_DEF_SERIALIZE(ObColumnSchemaV2)
|
||||
srs_id_,
|
||||
udt_set_id_,
|
||||
sub_type_,
|
||||
skip_index_attr_);
|
||||
skip_index_attr_,
|
||||
lob_chunk_size_);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -381,7 +384,8 @@ OB_DEF_DESERIALIZE(ObColumnSchemaV2)
|
||||
srs_id_,
|
||||
udt_set_id_,
|
||||
sub_type_,
|
||||
skip_index_attr_);
|
||||
skip_index_attr_,
|
||||
lob_chunk_size_);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -426,7 +430,8 @@ OB_DEF_SERIALIZE_SIZE(ObColumnSchemaV2)
|
||||
srs_id_,
|
||||
udt_set_id_,
|
||||
sub_type_,
|
||||
skip_index_attr_);
|
||||
skip_index_attr_,
|
||||
lob_chunk_size_);
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -521,6 +526,7 @@ int64_t ObColumnSchemaV2::to_string(char *buf, const int64_t buf_len) const
|
||||
K_(udt_set_id),
|
||||
K_(sub_type),
|
||||
K_(skip_index_attr),
|
||||
K_(lob_chunk_size),
|
||||
KPC_(column_ref_idxs));
|
||||
J_OBJ_END();
|
||||
return pos;
|
||||
|
@ -72,6 +72,7 @@ int assign(const ObColumnSchemaV2 &other);
|
||||
inline void set_order_in_rowkey(const common::ObOrderType order_in_rowkey) { order_in_rowkey_ = order_in_rowkey; }
|
||||
inline void set_udt_set_id(const uint64_t id) { udt_set_id_ = id; }
|
||||
inline void set_sub_data_type(const uint64_t sub_type) { sub_type_ = sub_type; }
|
||||
inline void set_lob_chunk_size(const int64_t chunk_size) { lob_chunk_size_ = chunk_size; }
|
||||
|
||||
int set_part_key_pos(const int64_t part_key_pos);
|
||||
inline int64_t get_part_key_pos() const
|
||||
@ -159,6 +160,7 @@ int assign(const ObColumnSchemaV2 &other);
|
||||
inline uint64_t& get_column_id() { return column_id_; }
|
||||
inline uint64_t get_udt_set_id() const { return udt_set_id_; }
|
||||
inline uint64_t get_sub_data_type() const { return sub_type_; }
|
||||
inline int64_t get_lob_chunk_size() const { return lob_chunk_size_; }
|
||||
inline int64_t get_schema_version() const { return schema_version_; }
|
||||
inline int64_t get_rowkey_position() const { return rowkey_position_; }
|
||||
inline int64_t get_index_position() const { return index_position_; }
|
||||
@ -373,6 +375,7 @@ private:
|
||||
uint64_t udt_set_id_;
|
||||
uint64_t sub_type_;
|
||||
ObSkipIndexColumnAttr skip_index_attr_;
|
||||
int64_t lob_chunk_size_;
|
||||
};
|
||||
|
||||
inline int32_t ObColumnSchemaV2::get_data_length() const
|
||||
|
@ -1584,6 +1584,7 @@ int ObSchemaRetrieveUtils::fill_column_schema(
|
||||
EXTRACT_INT_FIELD_TO_CLASS_MYSQL_WITH_DEFAULT_VALUE(result, udt_set_id, column, int64_t, true, true, 0);
|
||||
EXTRACT_INT_FIELD_TO_CLASS_MYSQL_WITH_DEFAULT_VALUE(result, sub_data_type, column, int64_t, true, true, 0);
|
||||
EXTRACT_INT_FIELD_TO_CLASS_MYSQL_WITH_DEFAULT_VALUE(result, skip_index_attr, column, uint64_t , true, true, ObSkipIndexColumnAttr::OB_DEFAULT_SKIP_INDEX_COLUMN_ATTR);
|
||||
EXTRACT_INT_FIELD_TO_CLASS_MYSQL_WITH_DEFAULT_VALUE(result, lob_chunk_size, column, int64_t, true, true, OB_DEFAULT_LOB_CHUNK_SIZE);
|
||||
|
||||
common::ColumnType default_type = column.get_data_type();
|
||||
if (column.is_generated_column() || column.is_identity_column()) {
|
||||
|
@ -396,6 +396,7 @@ void ObColumnParam::reset()
|
||||
is_virtual_gen_col_ = false;
|
||||
is_gen_col_udf_expr_ = false;
|
||||
is_hidden_ = false;
|
||||
lob_chunk_size_ = OB_DEFAULT_LOB_CHUNK_SIZE;
|
||||
}
|
||||
|
||||
void ObColumnParam::destroy()
|
||||
@ -453,7 +454,8 @@ OB_DEF_SERIALIZE(ObColumnParam)
|
||||
is_virtual_gen_col_,
|
||||
is_gen_col_udf_expr_,
|
||||
is_nullable_for_read_,
|
||||
is_hidden_);
|
||||
is_hidden_,
|
||||
lob_chunk_size_);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -494,6 +496,7 @@ OB_DEF_DESERIALIZE(ObColumnParam)
|
||||
LOG_WARN("Fail to deep copy cur_default_value, ", K(ret), K_(cur_default_value));
|
||||
}
|
||||
}
|
||||
OB_UNIS_DECODE(lob_chunk_size_);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -514,7 +517,8 @@ OB_DEF_SERIALIZE_SIZE(ObColumnParam)
|
||||
is_gen_col_,
|
||||
is_virtual_gen_col_,
|
||||
is_gen_col_udf_expr_,
|
||||
is_hidden_);
|
||||
is_hidden_,
|
||||
lob_chunk_size_);
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -532,6 +536,7 @@ int ObColumnParam::assign(const ObColumnParam &other)
|
||||
is_virtual_gen_col_ = other.is_virtual_gen_col_;
|
||||
is_gen_col_udf_expr_= other.is_gen_col_udf_expr_;
|
||||
is_hidden_ = other.is_hidden_;
|
||||
lob_chunk_size_ = other.lob_chunk_size_;
|
||||
if (OB_FAIL(deep_copy_obj(other.cur_default_value_, cur_default_value_))) {
|
||||
LOG_WARN("Fail to deep copy cur_default_value, ", K(ret), K(cur_default_value_));
|
||||
} else if (OB_FAIL(deep_copy_obj(other.orig_default_value_, orig_default_value_))) {
|
||||
@ -1321,6 +1326,7 @@ int ObTableParam::convert_column_schema_to_param(const ObColumnSchemaV2 &column_
|
||||
column_schema.is_virtual_generated_column());
|
||||
column_param.set_gen_col_udf_expr(column_schema.is_generated_column_using_udf());
|
||||
column_param.set_is_hidden(column_schema.is_hidden());
|
||||
column_param.set_lob_chunk_size(column_schema.get_lob_chunk_size());
|
||||
LOG_DEBUG("convert_column_schema_to_param", K(column_schema), K(column_param), K(lbt()));
|
||||
if (column_schema.is_generated_column()) {
|
||||
ObObj nop_obj;
|
||||
|
@ -234,6 +234,9 @@ public:
|
||||
inline bool is_hidden() const { return is_hidden_; }
|
||||
int assign(const ObColumnParam &other);
|
||||
|
||||
inline void set_lob_chunk_size(int64_t chunk_size) { lob_chunk_size_ = chunk_size; }
|
||||
inline int64_t get_lob_chunk_size() const { return lob_chunk_size_; }
|
||||
|
||||
TO_STRING_KV(K_(column_id),
|
||||
K_(meta_type),
|
||||
K_(order),
|
||||
@ -245,7 +248,8 @@ public:
|
||||
K_(is_gen_col),
|
||||
K_(is_virtual_gen_col),
|
||||
K_(is_gen_col_udf_expr),
|
||||
K_(is_hidden));
|
||||
K_(is_hidden),
|
||||
K_(lob_chunk_size));
|
||||
private:
|
||||
int deep_copy_obj(const common::ObObj &src, common::ObObj &dest);
|
||||
private:
|
||||
@ -262,6 +266,7 @@ private:
|
||||
bool is_virtual_gen_col_;
|
||||
bool is_gen_col_udf_expr_;
|
||||
bool is_hidden_;
|
||||
int64_t lob_chunk_size_;
|
||||
};
|
||||
|
||||
typedef common::ObFixedArray<ObColumnParam *, common::ObIAllocator> Columns;
|
||||
|
Loading…
x
Reference in New Issue
Block a user