The database stores data in the form of a two-dimensional table of rows and columns. However, it is stored as a one-dimensional string. Scale as in the following table:
EmpId |
Lastname |
Firstname |
Salary |
1 |
Smith |
Joe |
40000 |
2 |
Jones |
Mary |
50000 |
3 |
Johnson |
Cathy |
44000 |
This simple table contains the employee code (EMPID), the Name field (Lastname and Firstname), and the salary (Salary).
This table is stored in the computer's memory (RAM) and storage (hard disk). Although the memory and the hard disk are different in mechanism, the computer's operating system is stored in the same way. The database must store the two-dimensional table in a series of one-dimensional "bytes" that are written by the operating system to memory or hard disk.
The row database stores the data values in a row together, and then stores the next row of data. And so on
1,smith,joe,40000; 2,jones,mary,50000; 3,johnson,cathy,44000;
A column database stores the data values in a column together , then stores the next column of data, and so on.
; Smith,jones,johnson; Joe,mary,cathy; 40000,50000,44000;
This is just a simplified statement.
In the relational database domain, except the traditional Oracle, SQL Server, MySQL and other row-type database. There is a growing interest in the Data Warehouse-listed database.
Two-control1 rows are more suitable for OLTP, querying all columns of a record.
columns are more suitable for OLAP, and are ideal for use in data warehousing, such as data analytics, mass storage, and business intelligence. the numbers that are not often updated are involved . because of the difference in design. A column database has advantages over parallel query processing and compression. And the data is listed as cell storage, completely without considering data modeling or modeling is simpler. To query the data on which columns are computed, read the columns directly.
2 column in the storage area occupies a very large advantage, can effectively improve the data compression ratio, save storage space.
What is a row-type database and what is a column database