Virtual row mechanisms

In a previous post, we explained how Siodb organizes user data in column. A column storage table is great for OLAP environment (for long running queries on multi-dimensional tables). Nevertheless, the column storage structure is not the best choice for OLTP environment. Therefore we introduce mechanisms in Siodb which solve that issue. 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 times, 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 read, it has direct access to the addresses of other cells from the current row.

The Table Row Id

The 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 the 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:

Siodb master column in blocks

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 row on top of the physical column storage. For instance, when a user runs this kind of query:

select * from table_1 where column_8 = '[email protected]' ;

Siodb will seek first the cells from column_8 of table_1 which match the filter ‘us[email protected]’. 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.

Conclusion

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, provide high performance for OLTP systems.


Please comment below should you need more details.

Please follow and like us:
error

Leave a Reply

Your email address will not be published. Required fields are marked *

RSS
Twitter
Visit Us
LinkedIn