Data base size estimation for a table for 1 Crore rows:
| Columns | Datatypes | Row Size in bytes | Index key size |
| timestamp | INTEGER | 4 | |
| l_node | INTEGER | 4 | 4 |
| slot | SMALLINT | 2 | 2 |
| port | SMALLINT | 2 | 2 |
| vpi | SMALLINT | 2 | 2 |
| vci | INTEGER | 4 | 4 |
| subobject | SMALLINT | 2 | 2 |
| stat | SMALLINT | 2 | 2 |
| bucket | SMALLINT | 2 | 2 |
| total | FLOAT | 8 | |
| peak | FLOAT | 8 | |
| | | 40+9 =49 | 20 + 9 = 29 |
· Additional 9 bytes for slot entry while write the data to disk
Index size calculation:
Total Index size = 29 bytes
Account for Index Overhead = 36.25 bytes (29*1.25)
Initital table size = 10000000 bytes (1 crore rows)
Total index space needed = 362500000 bytes (36.25* 10000000)
Conversion to KB = 354003.90625 KB (345 MB)
Data size calculation:
Page length in bytes = 2048 – 28 = 2020 bytes **
Row length = 49 bytes
Rows per page = 2020/49 = 41 rows
Noof Datpags for table of 1c row = 243902 Pages (10000000/41) ****
Total pages to store data = 499511296 bytes (476 MB) *******
Approximate total space needed = 476(datasize)+345(index size) = 821 MB
** 28 bytes subtracted for page overhead
**** Total no of rows / rows per page
******* No of Data pages * 2048
No comments:
Post a Comment