orAcle table type introduction

Oracle database supports multiple types of tables, including but not limited to the following:

 

Heap Organized Table: This is the most basic and commonly used table in the Oracle database. The characteristic of the heap table is that when adding or deleting data, the first free space found in the segment that can accommodate the data will be used. When data is deleted from a table, future INSERTs and UPDATEs are allowed to reuse this space. It is used in a somewhat casual way. Many beginners will take it for granted that the data will be inserted in order. The first item must be ranked first, followed by the second item, until the end. But when performing a SELECT query, the results returned are often disappointing. The order of arrangement is astonishing. Generally speaking, database tables are essentially unordered combinations of data.

 

Index Organized Table (IOT): This is a table stored in an index structure. Unlike heap-organized tables, index-organized tables store data in the order of the key values ​​of the index, rather than in the order in which the data is inserted. The data of the index-organized table is stored in the B-tree index by means of primary key sorting. In addition to storing the primary key column values, the values ​​of the non-key columns are also stored. A normal index stores only the index columns, while an index-organized table stores the values ​​of all columns of the table. Index-organized tables are generally suitable for static tables, and queries mostly use primary key columns. When most columns of the table are used as primary key columns and the table is relatively static, it is more suitable to create an index-organized table. Index-organized tables do not have the space overhead of primary keys, because the index is the data, and the data is the index, and the two have been merged into one.

 

Temporary Table: A temporary table is a table used to temporarily store data. It is only visible during the validity period of the current session or transaction. At the end of the transaction or session, the data in the temporary table is automatically deleted. Temporary tables are divided into two types: Private Temporary Table and Global Temporary Table. A private temporary table can only be accessed within the session or transaction that created it, while a global temporary table will exist after the session or transaction that created it ends, and will not be deleted until it is explicitly deleted or the Maximum Session Number limit is exceeded. .

 

Materialized table (Materialized View): A materialized table is a view that is pre-calculated and stored in the database, which can improve query speed. Calculations for materialized tables can be based on query results or summary data from other tables. Materialized tables can be updated periodically to reflect changes to the underlying tables, or they can be manually forced to refresh when needed. Materialized tables can be divided into two types: snapshot materialized tables and update materialized tables. Snapshot materialized tables are only used for query acceleration, while update materialized tables can be used for data summary and statistics.

 

Partitioned Table: A partitioned table refers to a table that divides a large table into multiple smaller, more manageable parts for better management and query of data. Partitioning tables can improve query performance and manageability, especially when processing large amounts of data. Partition tables can be divided into four types: Range Partitioning, Hash Partitioning, List Partitioning, and List Hash Partitioning. A partitioned table can be partitioned when it is created, or an existing table can be partitioned later.

 

Subtable: A subtable refers to a table structure that contains another table. Child tables can contain column and row data from multiple parent tables to better organize and query data. Subtables are often used to manage hierarchical or related data.

 

External Table: An external table is a table structure that can directly read and parse data from external files without first importing the data into the database. External tables support multiple file formats, such as text files, CSV files, XML files, etc.

Guess you like

Origin blog.csdn.net/wtfsb/article/details/131238130