cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding Row Store & Column Store?

05-11-2012 2:46 AM
SridharKarra Participant
10848 views 10 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello Experts,

Can someone make me understand the attachments regarding row store & column store? I need to understand in each of the areas how the requests is processed by each component.

All help appreciated.

Thanks,

Sri K.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

former_member184871
Contributor
0 Likes

Conceptually, a database table is a two-dimensional data structure with cells organized in rows and columns. Computer memory however is organized as a linear structure. To store a table in linear memory, two options exist as shown in figure 2. 

A row-oriented storage stores a table as a sequence of records, each of which contains the fields of one row. Conversely, in a column store the entries of a column are stored in contiguous memory locations.

The concept of columnar data storage has been used for quite some time. Historically it was mainly used for analytics and data warehousing where aggregate functions play an important role. Using column stores in OLTP applications requires a balanced approach to insertion and indexing of column data to minimize cache misses. 

The SAP HANA database allows the developer to specify whether a table is to be stored column-wise or row-wise. It is also possible to alter an existing table from columnar to row-based and vice versa. 

Column-based tables have advantages in the following circumstances: 

* Calculations are typically executed on single or a few columns only.  

* The table is searched based on values of a few columns.  

* The table has a large number of columns.  

* The table has a large number of rows and columnar operations are required (aggregate, scan           etc.)  

* High compression rates can be achieved because the majority of the columns contain only few distinct values (compared to number of rows).  

Row based tables have advantages in the following circumstances: 

* The application needs to only process a single record at one time (many selects and/or updates of single records).  

* The application typically needs to access a complete record (or row).  

* The columns contain mainly distinct values so that the compression rate would be low.  

* Neither aggregations nor fast searching are required.  

* The table has a small number of rows (e. g. configuration tables).  

To enable fast on-the-fly aggregations, ad-hoc reporting, and to benefit from compression mechanisms it is recommended that transaction data is stored in a column-based table. The SAP HANA data-base allows joining row-based tables with column-based tables. However, it is more efficient to join tables that are located in the same row or column store. For example, master data that is frequently joined with transaction data should also be stored in column-based tables.

Former Member
0 Likes

Please read the research paper published by Hasso Plattner, on why In-Memory Column database is superior for performance.

http://www.sigmod09.org/images/sigmod1ktp-plattner.pdf

Answers (5)

Answers (5)

Former Member
0 Likes

Very Well Explained here : SAP HANA Academy

https://www.youtube.com/watch?v=xO-DwghE6N0

Thanks,

Uday

Former Member
0 Likes

Hi Guys,

I have small doubt here. Can some one please explain me, how data is fetched from column store and how it increases the speed of fetching the data ?

I know that, data is stored in column wise. But i didn't uderstood how data is connected for a single record in column store and how it reads fastly?.

lbreddemann
Active Contributor
0 Likes

There are meanwhile several options available to learn about this.

A convenient way e.g. is Richard's and my book .

- Lars

praveenkm
Explorer
0 Likes

This message was moderated.

Former Member
0 Likes

Hi Sridhar,

Row Store – Traditional Relational Database, the difference is that all the rows are in memory in HANA where as they are stored in a hard drive in traditional databases.

Column Store – The data is stored in columns like in SAP BWA.

Former Member
0 Likes

Hi  Sridhar,

Row based tables store a table in a sequence of rows and the benefits of this is

a) easier to insert and update

b) the data is stored together

The disadvantages are

a) all data in a row has to be read even though the requirement may be to access data from a few columns (in analytical processing)

Column based tables store a table in a sequence of columns and the advantages are

a) Only affected colums have to be read during the selection process of a query.

b) Any of these columns can serve as an index

The disadvantages are

a) After selection selected rows have to be reconstructed from columns.

b) There is no easy way to insert / update.

The other advantage is column stores are easier to compress, by working with dictionaries where the attributes are represented in dictionaries using integer values.

Former Member
0 Likes

Hi Sridhar,

Could you attach the images again - both JPGs don't show...

--Juergen

SridharKarra
Participant