当前位置:网站首页>Dameng database_ Supported table types, usage, characteristics
Dameng database_ Supported table types, usage, characteristics
2022-07-24 06:11:00 【ls2best】
Dameng database has : Common watch 、 Partition table 、 A temporary table 、 Heap table (rowid)、 List and save list (HUGE)、 External tables, etc . The default common table is the index organization table ( Index organization table , No primary key utilization rowid).
One 、 Common watch ( Index organization table )
Ordinary watches are based on B Stored in tree form ,ROWID It's all logical ROWID, From 1 Keep growing . In the case of concurrency , Logic generation is required during each insertion ROWID, This affects the efficiency of inserting data ; Every piece of data needs to be stored ROWID value , It will also cost a lot of storage space .
Two 、 Heap table
Using physics ROWID Form heap table ,DM The clustered index is adjusted inside the server , There is no tradition B Tree structure , In its place “ flat B Trees ”, Data pages are stored in the form of linked lists . To support concurrent insertion , flat B Trees can support up to 128 Linked list of data pages ( most 64 Concurrent branches and up to 64 Non concurrent branches ), stay B The control page of the tree records the first of all linked lists 、 Last page address .
For non concurrent branches , If there are multiple branches , That is, there are multiple linked lists , After different users log in to the system , According to its affairs ID Number , Randomly select a linked list to insert into the heap table .
For concurrent branches , Then different users will choose different branches to insert , If multiple users choose the same branch , You need to wait for other users to finish inserting and release the lock before inserting . In the case of concurrency , Different users can insert on different linked lists , Efficiency has been greatly improved .
SQL The table creation statement specifies You can create tables in STORAGE Option specifies the table form to be created , There are three keywords related to the form of heap table creation , Namely NO BRANCH、BRANCH、CLUSTERBTR.
NOBRANCH: If specified as NOBRANCH, The created table is a heap table , The number of concurrent branches is 0, The number of non concurrent branches is 1;
BRANCH(n,m): If in this form , The created table is a heap table , The number of concurrent branches is n, The number of non concurrent is m;
BRANCH n: Specify that the created table is a heap table , The number of concurrent branches is n, The number of non concurrent branches is 0;
CLUSTERBTR: The created table is an index organization table .Heap table because of its own characteristics , Compared with ordinary watches , It also adds some restrictions to yourself :
1、 No clustered index , If users need to sort data with the help of clustered index primary key, heap table is not recommended ;
2、DM The column storage of heap table is not supported at present ;
3、 Do... On the watch alter operation , Data records rowid It could change , It will cause index reconstruction .
Maintenance of heap table : The heap table is in the process of data scanning , It has its inherent advantages . If you know the data record ROWID, Then you can directly ROWID decode , Get the file number of the record 、 Page number and in page offset , That's the record . Therefore, it is recommended to establish a secondary index on the frequently queried columns , In this way, during operation , First find the record through the secondary index ROWID, You can find the data directly , The efficiency has been greatly improved . Heap table supports the ALTER operation , However, it is recommended not to carry out such operations easily . Do... On the watch ALTER operation , Data recorded ROWID It's possible to change , So every time ALTER operation , It is possible to rebuild the index , It takes more time . Damon database supports the backup and restore of heap tables . When restoring data ,B Tree data and secondary indexes can be restored at the same time .
3、 ... and 、HUGE surface / Column storage table
1、HUGE FILE SYSTEM: It is owned by Dameng database , An efficient table for analyzing massive data , The column storage table is built on HFS( Hierarchical file management system ) Upper .
2、HUGE Tables are built on their own unique table spaces HUGE Table space , Default in HMAIN On table space .
3、 Relevant information exists V$huge_tablespace in . You can create at most 32767 individual huge Table space .
4、 establish HUGE Table time , according to with and without To determine whether the table is non transactional or transactional HUGE surface .
5、HUGE Table is the same as ordinary row table , You can add, delete, and modify .
6、 but HUGE The efficiency of deleting and updating tables will be lower than that of row tables , The performance of concurrent operation will be worse than that of row .
HUGE Some limitations of the table :1、 Support definition NULL,NOT NULL, UNIQUE ,PRIMARY KEY 2、HUGE The table does not build a clustered index , Allow secondary indexing , Bitmap indexing is not supported , among unique Do not check uniqueness . 3、 Table space restrictions are not supported 4、 Large field columns are not supported 5、 Full text indexing is not supported 6、 Creating triggers is not supported 7、 Triggers are not allowed .
Four 、 External table
The external table is the data of the table and will not be placed in the database , It will be placed in the file of the operating system . You can view the data of external files through the external tables of the database .1、 When creating an external table , No pages will be generated 、 cluster 、 Storage structures such as segments .2、 Only table related definitions can be placed in the database dictionary , You cannot modify the contents of an external table (update、instert、 delete)3、 Cannot create an index on an external table .4、 External tables can be accessed through SQL Statement decoder to complete . There is no need to load external tables into the database .
purpose : To access other data is not in the database , To check the data .
5、 ... and 、 Partition table
In order to improve the efficiency of the database in large amount of data reading and writing operations and queries , Damon database provides the technology of partitioning tables and indexes , Divide the data in database objects such as tables and indexes into small units , Stored separately in separate sections , Users' access to tables is transformed into access to smaller segments , To improve the performance of large application systems . Damon provides a way of horizontal zoning , This method includes the scope (range)、 Hash (HASH) And list (list)、 Interval partition (interval) Four ways .
The method of partitioning :
(1) Range (range) Partition : Partition the range of values on some columns in the table , According to the range of a certain value , Decide on which partition to store the data .
(2) Hash (hash) Partition : A partition type that evenly distributes data by specifying partition numbers , By means of I/O Hash partition on device , Make these partitions basically the same size .
(3) list (list) Partition : By specifying the discrete value set of a column in the table , To determine what data should be stored together .
(4) interval (interval) Partition : The interval partition is actually the same as the range partition , But it is more advanced than range partitioning . Range partition requires us to manually allocate each range interval , So it is not so flexible to use . For example, the data of a company , You want to partition by year , Manually add a partition every year , More trouble . And interval partition can perfectly solve this kind of problem .
(5) Multi level partition table : Any combination of the above three methods .
matters needing attention :
1、 Solve the problem that the partition table is out of range , Range partition keywords :MAXVALUE, List partition DEFAULT.
2、 A locally unique index must contain all partition columns , Create a partitioned table if the table has a primary key column , Partition columns must contain primary keys . There is no primary key column or unique index column in the partitioned table , You can create .
3、 Even if the heap table has primary key columns or unique index columns, partitions can be created .
4、 Each sub table of the horizontal partition heap table must be located in the same table space . There is no heap table , Partitioned tables can be in different table spaces .
6、 ... and 、 A temporary table
1、 Temporary table spaces cannot be created in Damon , Users cannot manually create temporary tablespaces ;
2、 Can create temporary tables ;
3、 Users can use system functions sf_rest_temp_ts Free table space ;
4、 adopt select * from v$dm_ini where para_name link ‘%TEMP%’;
5、 adopt sp_set_para_value(2,‘temp_size’,200) Set the temporary tablespace size ;
6、 The occupied size of temporary tablespace files on disk will not be reduced , The user can go through sf_rest_temp_ts To clean up disk space ;
7、TEMP The tablespace is automatically maintained by Damon database
-- The temporary table is divided into two levels :( Transaction level , Session level ):
-- 1、on commit delete rows: Temporary tables are transaction level , After each transaction commit or rollback , All data in the table is deleted .
-- 2、on commit paresrve rows: Specify that the temporary table is session level , Empty the table at the end of the session .
CREATE GLOBAL TEMPORARY TABLE TEMP_SESSION_TAB (ID INT,NAME VARCHAR(20))
ON COMMIT PRESERVE ROWS; -- Create session level temporary tables .
CREATE GLOBAL TEMPORARY TABLE TEMP_TRX_TAB (ID INT , NAME VARCHAR(20))
ON COMMIT DELETE ROWS; -- Create transaction level temporary tables .
SELECT * FROM SYS.DBA_TABLES WHERE DBA_TABLES.TABLE_NAME LIKE 'TEMP_%';Dameng community address :https://eco.dameng.com
边栏推荐
- Deepsort summary
- Signals and systems: Hilbert transform
- Detailed explanation of KMP code distribution
- [deep learning] teach you to write "handwritten digit recognition neural network" hand in hand, without using any framework, pure numpy
- unity最新版本的Text(TMP)UI文本怎么显示中文
- [MYCAT] MYCAT installation
- [activiti] personal task
- vsual studio 2013环境 Udp组播
- Traditional K-means implementation
- Jestson installs IBus input method
猜你喜欢

JUC concurrent programming foundation (9) -- thread pool

unity2D游戏之让人物动起来-下

JDBC初级学习 ------(师承尚硅谷)

How to solve the problem of large distribution gap between training set and test set

Unity Shader :实现漫反射与高光反射
![[activiti] group task](/img/f1/b99cae9e840d3a91d0d823655748fe.png)
[activiti] group task
![[MYCAT] Introduction to MYCAT](/img/26/8911fe9e1fb104d7185dda0881804b.png)
[MYCAT] Introduction to MYCAT

Day-7 JVM end

Headlong platform operation
![[principles of database system] Chapter 5 algebra and logic query language: package, extension operator, relational logic, relational algebra and datalog](/img/6a/c30b139823208a2e021135a4bf8d58.png)
[principles of database system] Chapter 5 algebra and logic query language: package, extension operator, relational logic, relational algebra and datalog
随机推荐
Foundation of JUC concurrent programming (8) -- read write lock
Qt char型转QString型 16进制与char型 转 16进制整型
MySQL foundation - constraints
Raspberry pie is of great use. Use the campus network to build a campus local website
Lua基础
JVM system learning
Unity基础知识及一些基本API的使用
Unity(三)三维数学和坐标系统
Opencv reads avi video and reports an error: number < Max_ number in function ‘icvExtractPattern
JUC concurrent programming foundation (9) -- thread pool
The problem that the user name and password are automatically filled in when Google / Firefox manages the background new account
Vsual studio 2013 environment UDP multicast
【数据库系统原理】第四章 高级数据库模型:统一建模语言UML、对象定义语言ODL
Xshell remote access tool
Vscode multiline comments always expand automatically
MySql与Qt连接、将数据输出到QT的窗口tableWidget详细过程。
顺序栈 C语言 进栈 出栈 遍历
[FatFs] migrate FatFs manually and transfer SRAM virtual USB flash disk
MySql下载,及安装环境设置
[principles of database system] Chapter 4 advanced database model: Unified Modeling Language UML, object definition language ODL