All Forums Database
kasun 3 posts Joined 07/11
29 Dec 2015
How could Cylinder index scan achieve the "select count(*) from table X" ?

As far as i know, since TD 13, CI is used for "select count(*) from table x" instead of full table scan. But from the manual, 
CI stores below information , But i do not undertand how TD get the row count from below information ?
My concern is  : 1) same rowhash could have different rowID  2)rowhash value may not be simply increased by 1, like 1,2,3, it may be 1,5,8.
so, how could TD get row count from the Cylinder Index  ? Does it keep any other more information  ?

Each cylinder index entry contains the following data sorted on table ID and rowhash.

•Table ID for the table stored in the block (rows from different tables are never mixed in the same data block)

•Lowest rowID value in the block

•Highest partition/rowhash value in the block

The partition is 0 for NPPI tables.

•Sector number for that block

•Number of sectors in the block

CarlosAL 512 posts Joined 04/08
30 Dec 2015

The Cylinder Index contains:
The Subtable Reference Descriptors (they have the Table ID and the range of Data Block Descriptors).
The Data Block Descriptors have the Row count (a data block can only contain rows of one table).
The sum of the rowcounts of the DBD for a table can be extracted from the Cylinder Index.

kasun 3 posts Joined 07/11
07 Jan 2016

Thanks a lot for the output, Carlos!

You must sign in to leave a comment.