Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Table size

Former Member
0 Kudos

Hi Gurus,

I need to create a table with around 50 fields for transaction data with size 4.

How i know how much memory it takes to store each record in disk and what is load on CPU when updating Ztable thru FM?

<REMOVED BY MODERATOR>

Giri

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:12 PM

1 ACCEPTED SOLUTION

vinod_vemuru2
Active Contributor
0 Kudos

Hi Giri,

Size on Disk will be equal to sum of sizes of all 50 fields.

eg: Character field has One byte memory. So if u have a field of CHAR10 it will accupy 10bytes.

For knowing load on CPU u can get in touch with ur BASIS team. They will take care of these things so that system will not crash even in peak load.

Thanks,

Vinod.

12 REPLIES 12

Former Member
0 Kudos

guys?

any help?

how many bytes it take to store a record in VBAK table for example when creating quotation?

Giri

vinod_vemuru2
Active Contributor
0 Kudos

Hi Giri,

Size on Disk will be equal to sum of sizes of all 50 fields.

eg: Character field has One byte memory. So if u have a field of CHAR10 it will accupy 10bytes.

For knowing load on CPU u can get in touch with ur BASIS team. They will take care of these things so that system will not crash even in peak load.

Thanks,

Vinod.

0 Kudos

Vinod,

Thanks for reply...

u mean if i have 50 char10 fields it takes 500 bytes for 1 record?

suppose if i have 1 million records of 500 bytes( above scenario) then reading ztable what is load on CPU?

suggestion will be helpful...

Giri

0 Kudos

Hi Giri,

Yes u r right.

In program when u refer internal table to database table, Go to dubug mode and click on the internal table. It will show some thing like 0 by 2345. This 2345 is the size of each record.

Paste this code.

DATA: i_vbak TYPE TABLE OF vbak.

SELECT * FROM VBAK INTO TABLE i_vbak UP TO 10 rows.

*Here check the table i_vbak in debug mode.

If sy-subrc IS INITIAL.

WRITE sy-dbcnt.

ENDIF.

In this case it will be 727 bytes. If u add field lengths of all the

fields u will get 727 bytes.

Reading one million records may cause performance problems.

2 solutions for this are....

1. Run ur object as batch job so that no probs with time out errors.

2. Fetch the data in chunks of 1000 using PACKAGE SIZE option of SELECT statement.

But if u get 1 million records into ur internal table never do DELETE on the this. It will still worsen the performance.

In this case u can use APPEND to new internal table instead of delete.

Thanks,

Vinod.

0 Kudos

Hi.

Something that might be important for the size of your table is which codepage your system is running. On a Unicode system 7-bit-character fields normally need more space than on a ASCII or EBCDIC system. And depending on your database you might have different types of Unicode (UTF-8, UTF-16). And note that if you delete entries from a table you often will not get space back on disk immediately. But this is highly depending on your database type. Transaction DB02 gives some details about the size of existing tables.

Regarding CPU-load: thats nearly impossible to guess... There are caching techniques used in the database and your operating system. Even the hard disks have caches and everything in this area depends on your server architecture, hardware and operating system.

Best regards,

Jan Stallkamp

0 Kudos

HI Jan,

This ECC 6.0 Unicode system.

then what will be the size of the record for 50 fields with char10 in unicode system ( i believe UTF-8)?

what is the difference for this method which vinod described with unicode system?

Giri

0 Kudos

Hi.

>

> HI Jan,

>

> This ECC 6.0 Unicode system.

>

> then what will be the size of the record for 50 fields with char10 in unicode system ( i believe UTF-8)?

>

> what is the difference for this method which vinod described with unicode system?

>

> Giri

The main problem is that the table on the database is not just an array of characters. With Vinod's method you can find out the length of one table record. But as I said before the database may not free deleted records immidately. Then there has to be some additional information like indexes, keys, constraints... And depending on the database one unicode character may need a variable amount of space on disk depending on the character's value (some databases have fixed length in contrast). And there are a lot of database and data specific factors that influence the actual size. If you want to see the real size: look into DB02. If you just want a rough estimate about the size of a table in memory: number of rows times record size as suggested by Vinod is good.

Best regards,

Jan Stallkamp

0 Kudos

One thing to add: Please don't use words like urgent in your subject. What is urgent is very much depending on the person. Maybe something is urgent to you but to your readers it is not... That's one of the reasons why I normally don't answer any question marked as urgent or similar.

Jan Stallkamp

0 Kudos

Jan,

Sorry for the word Urgent.... i need to present the all data size for tables and all.. need to calculate...

thanks for reply...

Giri

0 Kudos

Hi Giri.

No problem. Just don't use words like that in subject lines. Have a look into our community guidelines from time to time. I hope you can solve all your problems with using DB02.

Best regards,

Jan Stallkamp

Former Member
0 Kudos

hi i am not sure about the exact answer .....but we can find the field length in the bytes..like this.

report ztest.

tables:mara .

DATA: text TYPE c LENGTH 1,

blen TYPE i,

clen TYPE i,

bytes TYPE i.

DESCRIBE FIELD text: LENGTH blen IN BYTE MODE,

LENGTH clen IN CHARACTER MODE.

bytes = blen / clen.

0 Kudos

Hi venkat,

this means for VBELN field also the no: of bytes is 2?

for 1 length character and 10 length character same bytes?

i am confused in that...

pls help...

my question is:

i have a ztable of 50 fields with char10 data type.

how many bytes of memory its using for 1 record?

Giri

Edited by: Giri K on Jun 11, 2008 1:27 PM