In a previous post, we explained how Siodb organizes user data in columns. A column storage table is great for OLAP environments (for long-running queries on multi-dimensional tables). But, Siodb gives nice mechanisms for OLTP environments. Let’s discover them in this article.
The Cell Address Set
First of all, Siodb indexes all cells from each column of each table. In order to rapidly identify any cells at any time, Siodb allocates an address to each cell. Thanks to this mechanism, Siodb is able to maintain a set of cell addresses per row. Furthermore, each cell has a pointer to its Cell Address Set. So, no matter which cell Siodb currently reads, it has direct access to the addresses of other cells from the current row.
Table Row Id
Table Row Id is a unique numerical identifier. Siodb increments this Table Row Id per table for each insert transaction. Thus, all rows in a table are uniquely identified by this Table Row Id. Also, Siodb adds the Table Row Id of a given row to the Cell Address Set of that row.
The Master Column
The Master Column is an invisible column that Siodb automatically updates over time. In this respect, when Siodb produces a Cell Address Set including the Table Row Id, it stores this set into the Master Column. Hence, Siodb constantly knows where the cells of a row are physically stored and can quickly access to them with a minimum amount of I/Os.
How the Master Column links cells together:
In the previous schema, we can see the link that the Master Column creates between cells of the same row. This provides a virtual representation in rows on top of the physical column storage. For instance, when you run this kind of query:
select * from table_1 where column_8 = 'email@example.com' ;
Siodb will seek first the cells from column_8 of table_1 which match the filter ‘firstname.lastname@example.org’. For each cell, Siodb gets immediate access to the Cell Address Set in the master column from where Siodb gets the addresses of remaining cells in the current row.
To conclude, the Master Column, the Table Row Id and the Cell Address Set together create a virtual row representation of table data. Which in turn, gives you high performance for OLTP systems.
Your feedback is WANTED. Please give us your input by commenting below.