How to measure the size of one record in a table

Yuki21
Tera Expert
Is it possible to measure the approximate size of one record in a table by the following method?

<Measurement method>
Check the difference between the Primary DB size (MB) of the Application Usage Overview before and after adding the record to the table.
* Create 10,000 records and divide the difference by 10,000

Is the Primary DB size (MB) reflected immediately after adding a record?
1 ACCEPTED SOLUTION

MySQLに一般的にテーブルを作成した話になります。

varcharがemptyの場合は0バイトになります。

Integerは4バイト

Date/Timeは8バイト

ReferenceはGUIDなので32バイト

Floatは4バイト

因みに次ぎのNow Support記事によると40文字以下はvarchar(40)です。

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685779

 

ただし、ServiceNowのテーブルとデータベースのテーブルは異なる場合があります。

データベースのテーブル名はsys_storage_aliasテーブルで見ることができます。列Storage table nameがデータベースのテーブルで、列TableはServiceNow上での論理テーブルのようです。例えば、cmdbを継承したテーブルは実際はすべて物理テーブルcmdbにあります。baseテーブルは物理テーブルで、extendedテーブルはbaseテーブル内に作成されているようです。

実際には分かりませんが、extendedテーブルは物理テーブルで列で識別されているように見えます。

次ぎのNow SupportページにTaskテーブルについての説明があります。

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0713626

 

話は最初に戻りますが、何故レコード長が必要なのでしょうか?

ServiceNowのようなaPaaSの利点は色々なミドルウエア技術が隠蔽されていてアプリのみに集中することであると思います。ServiceNowから提供されちるベストプラクティスに基づいて作成/運用して、それで問題が発生した場合はServiceNowに改善も求めることが出来ます。

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hi Yuki,

I think you have asked this question before as well and got your answer too:

https://community.servicenow.com/community?id=community_question&sys_id=f2d7b5cd1b8849d01e579979b04bcb0e

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hitoshi Ozawa
Giga Sage
Giga Sage

Database like MySQL and Oracle supports VARCHAR column type. That is, a column length is varies depending on the size of the entered data. Size of TEXT columns also varies depending on the size of the entered data.

Since String is commonly used  type in ServiceNow tables, size of a record would change with each record.

As such, trying to measure the "approximate" size won't mean too much. It would be better to try to find maximum size of a record and mean or average size of a record. Can get these values from calculating number of characters entered in each columns.

 

 

 

ありがとう。
たとえば、次のテーブル定義を使用して1レコードあたりの最大バイト数を計算するにはどうすればよいですか?
Stringの最大長が40の場合、最大バイト数はどうなりますか?

find_real_file.png

MySQLに一般的にテーブルを作成した話になります。

varcharがemptyの場合は0バイトになります。

Integerは4バイト

Date/Timeは8バイト

ReferenceはGUIDなので32バイト

Floatは4バイト

因みに次ぎのNow Support記事によると40文字以下はvarchar(40)です。

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0685779

 

ただし、ServiceNowのテーブルとデータベースのテーブルは異なる場合があります。

データベースのテーブル名はsys_storage_aliasテーブルで見ることができます。列Storage table nameがデータベースのテーブルで、列TableはServiceNow上での論理テーブルのようです。例えば、cmdbを継承したテーブルは実際はすべて物理テーブルcmdbにあります。baseテーブルは物理テーブルで、extendedテーブルはbaseテーブル内に作成されているようです。

実際には分かりませんが、extendedテーブルは物理テーブルで列で識別されているように見えます。

次ぎのNow SupportページにTaskテーブルについての説明があります。

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0713626

 

話は最初に戻りますが、何故レコード長が必要なのでしょうか?

ServiceNowのようなaPaaSの利点は色々なミドルウエア技術が隠蔽されていてアプリのみに集中することであると思います。ServiceNowから提供されちるベストプラクティスに基づいて作成/運用して、それで問題が発生した場合はServiceNowに改善も求めることが出来ます。