Calculating the size of each record in a table?

Hi to all,
I trying to create histograms based on the unique record sizes in a particular table. However , in order to do that I need to calculate the size of each record in the table (in kilobytes preferably) and to get a list of unique record sizes.
Is there a function or easy way to calculate the size in Kbytes of a record in a table?
Thank you in advance!
Tony

Hi,
You can use the sum of the average of the vsizes of the fields in the table. For example:TEST.SQL>CREATE TABLE TEST
  2  (
  3  A VARCHAR2(50 CHAR),
  4  B NUMBER
  5  ) TABLESPACE TOOLS;
Table created.
TEST.SQL>INSERT INTO TEST VALUES('&1',&2);
Enter value for 1: A
Enter value for 2: 10
old   1: INSERT INTO TEST VALUES('&1',&2)
new   1: INSERT INTO TEST VALUES('A',10)
1 row created.
TEST.SQL>/
Enter value for 1: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Enter value for 2: 100000
old   1: INSERT INTO TEST VALUES('&1',&2)
new   1: INSERT INTO TEST VALUES('ABCDEFGHIJKLMNOPQRSTUVWXYZ',100000)
1 row created.
TEST.SQL>COMMIT;
Commit complete.
TEST.SQL>SELECT AVG(VSIZE(A)) + AVG(vSIZE(B)) FROM TEST;
AVG(VSIZE(A))+AVG(VSIZE(B))
                       15.5                                  The average line size - from the data in the table NOW - is 15.5 bytes.
HTH,
Yoann.

Similar Messages

  • Calculating the size of the database in memory

    Hi,
    I am using BDB 5.1.19 with BTREE as an access method.
    I would like to calculate the memory footprint that would be needed for that.
    I followed the following doc:
    useful-bytes-per-page = (page-size - page-overhead) * page-fill-factor
    bytes-of-data = n-records *
    (bytes-per-entry + page-overhead-for-two-entries)
    n-pages-of-data = bytes-of-data / useful-bytes-per-page
    total-bytes-on-disk = n-pages-of-data * page-size
    I am not interested in calculating the size on disk but just in memory.
    Would the following be enough:
    bytes-of-data = n-records *(bytes-per-entry + page-overhead-for-two-entries)
    Since the rest is only for space on disk i don't need it, is that correct?
    Would this calculation help me also to calculate the cache size or is the cache size influenced by the page size?
    Thx.

    This is not a replication question and those of us monitoring this forum are not the best people to answer this question. You'll probably get a better and faster answer if you post it to the general Berkeley DB forum:
    Berkeley DB
    Paula Bingham
    Oracle

  • How do I find out the size of each individual element within a photoshop file as need to replace some elements?  Thanks :)

    How do I find out the size of each individual element within a photoshop file as need to replace some elements?  Thanks

    What do you mean by "Elements"?
    Elements in a flat image or Layers?
    Could you please post a screenshot with the Layers Panel visible?

  • While recording in captivate 4 I get a pop at the beginning of each recording

    While recording narration over a PP conversion in captivate 4 I get a pop at the beginning of each recording,  It doesn't seem to matter if I use keyboard shortcut or the mouse. Any thoughts?
    Paul

    Welcome to our community
    Is the unwanted bit part of the countdown?
    If so, there are a couple of ways to avoid it.
    1. Don't record your narration at the same time you record the actions. Record it separately. No narration means no countdown.
    2. After the countdown stops, consider that first slide to be a throwaway and ensure you don't begin recording in earnest until after you hear the first camera shutter sound.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Time Machine: How can I find the size of each individual backup?

    When I look in the Time Machine external hard drive under Backups.backupdb, I see all of the backups. I also see the total space remaining on the Time Machine. However, I would like to know the size of each individual backup file. Is there a way to get this information? It does not show in the "Get Info" window of the backup.
    Thanks

    The question is ambiguous, because a snapshot may consist almost entirely of references to other snapshots and thus take up almost no space on the backup volume. There is a shell command that enables you to see how much data was copied from the sources in the last snapshot. An example of how to use it is below.
    Triple-click anywhere in the line below to select it:
    tmutil compare
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V).
    The command will take at least a few minutes to run. Eventually some lines of output will appear below what you entered.
    Each line that begins with a plus sign (“+”) represents a file that has been added to the source volume since the last snapshot was taken. These files have not been backed up yet.
    Each line that begins with an exclamation point (“!”) represents a file that has changed on the source volume. These files have been backed up, but not in their present state.
    Each line that begins with a minus sign (“-“) represents a file that has been removed from the source volume.
    Files that you’ve excluded from backup, or that are excluded automatically, are ignored.
    At the end of the output, you’ll get some lines like the following:
    Added:
    Removed:
    Changed:
    These lines show the total amount of data added, removed, or changed on the source(s) since the last snapshot.

  • In CS6, why the file size remains same after croping? And how do I reduce the size after each cropin

    In CS6, why the file size remains same after croping? And how do I reduce the size after each croping? Thx

    Select the Crop Tool and check the box [  ] Delete Cropped Pixels and you should see a reduction in file size.  With the box unchecked, the data is still maintained in the document, you just can't see it.
    -Noel

  • HELP !!! How can I set the size of each component separately

    Please tell me, when adding components (a mix of
    labels , buttons etc.) on a container (swing), how can I set the size
    of each component separately.
    for example:
    the code here has a mix of button and a grid that is actually another JPanel. Its a part of a bigger
    program. When running the grid is cut (not seen in its full size).
    So, please try to anser also about the specific acse of frame contining another frame in it , and the interior should be right sized.
    The relevant part of the code:
    =========================================
    public class Reversi extends JFrame {
    public static void main(String[] args) {
    Reversi ourGame = new Reversi();
    public Reversi() {
    super("Grid Reversi");
    setSize(new Dimension(300, 300));
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    Grid g = new Grid(); // the grid was built at another part..
    ReversiGame ourGame = new ReversiGame();
    JButton b;
    JFrame f = new JFrame("Hello Java");
    f.setSize(new Dimension(300, 300));
    f.setDefaultCloseOperation(EXIT_ON_CLOSE);
    Container c = f.getContentPane();
    c.add(g,BorderLayout.NORTH );
    c.add(b = new JButton("Hola"), BorderLayout.CENTER);
    //f.pack();
    f.show();

    BorderLayout chooses the sizes of each of the components added to it. Choose a different layout manager (or set the placement/size manually with a 'null' layout)
    http://java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html

  • How to call webservice for each record in a table using ODI

    Hi
    I am new to ODI and Webservice. I want to invoke a scenario in ODI using web service. I hava a weblogic application server with axis 2 deployed.
    But I want call webservice for each record in a table
    For eg: "EMP" table have 50 records, for each record web service should invoke
    Can any one help me on it.
    Thanks,
    phani
    Edited by: user12774166 on Jun 6, 2010 11:16 PM

    If your goal is "call" a web service, Jason's Straub's [flex-ws-api|https://flex-ws-api.samplecode.oracle.com/] is by far the best I've seen. You might want read more about it on [his blog|http://jastraub.blogspot.com/search?q=+flex_ws_api+].
    Tyler Muth
    http://tylermuth.wordpress.com
    [Applied Oracle Security: Developing Secure Database and Middleware Environments|http://sn.im/aos.book]

  • Size of few records in a table.

    Hi Friends,
    To get the size of a table i executed the below query
    select BYTES from user_extents where segment_name = 'EMP';
    How to get the size of few records / rows in a table? For example get the size of records in EMP table where DEPTNO=10

    Hi PASB,
    I'm not sure what you are trying to do. If you want to find the length or a row you can use the length() function or one of its variants, but this can give dubious results if you are doing this for storage purposes, due to the way Oracle stores numbers and dates.
    If you are doing this for storage estimate purposes, then a better way is to analyze a representative table of the data and then use the average row length reported in the data dictionary. This can then be multiplied by the number of rows you need to store and then multiplied by a factor to allow for storage overhead. I find about 1.1 is a reasonable factor for tables.
    The same can be done for B-tree indexes but the overhead factor is higher, say about 1.5.
    Of course you can also get accurate estimates by looking at how much space a table/index currently consumes and extrapolating this.
    Regards
    Andre

  • How can i get the rowNumber of a record in a table ?

    How can i get the rowNumber of a record in a table ?

    Marcel,
    Please consult the "Tables" chapter in the UIX Developer's Guide. You can search for a method titled "doSelectionEvent" that will indicate how to deal with table selections.
    Hope this helps,
    Ryan Pollock

  • Can I plot 2 locations at the same time for each record in a table

    I'm trying to plot 2 Locations (2 points on a Power View Map) at the same time for each record/project in a table
    I can plot 1 location for each project of course with no problem
    but I'm trying to show the Begin Point and the
    End Point for each project at the same time
    Is this even possible?

    First of all THANKS this worked!
    But now I stumbled on another issue. So I actually have 3 tables (and I've adopted them to the file you sent)
    Table 1 => TripData
    Trip
    LongLat
    Location
    Type
    TypeCode
    Size
    NW Tour
    47.568077, -122.320800
    Seattle, WA
    Begin
    0
    1
    NW Tour
    47.035608,   -122.884812
    Olympia,   WA
    End
    1
    1
    Cali Trip
    37.808848, -122.412580
    San Francisco, CA
    Begin
    0
    1
    Cali Trip
    32.682611, -117.178348
    San Diego, CA
    End
    1
    1
    Table 2 =>
    TripInfo
    Trip
    OneLongLat
    NTP
    NW Tour
    47.568077, -122.320800
    1/1/2015
    Cali Trip
    37.808848, -122.412580
    1/5/2015
    Table 3 =>
    ALLTrips
    Trip
    Stop
    Owner
    NW Tour
    1
    Owner1
    NW Tour
    2
    Owner2
    NW Tour
    3
    Owner3
    NW Tour
    4
    Owner4
    NW Tour
    5
    Owner5
    Cali Trip
    1
    Owner6
    Cali Trip
    2
    Owner7
    Cali Trip
    3
    Owner8
    Cali Trip
    4
    Owner9
    Cali Trip
    5
    Owner10
    Cali Trip
    6
    Owner11
    This is how the Diagram View looks like in PowerPivot
    Trip Data => Trip Info <= ALLTrips
    Since I don't know how to post pictures
    The MAP FIELDS are as follows
    SIZE - Count of Stop(s)
    LOCATIONS - OneLongLat followed by
    LongLat (drill down feature)
    COLOR - Trip
    The problem now happens with the drill down feature
    You can either plot OneLongLat which is the general location for each trip
    Or LongLat of each trip which shows the begin and end points
    But you can't use the drill down feature???
    If instead of OneLongLat you use a
    State Column it actually works!!!
    I wonder if it has to do with the fact that both locations used for the drill down are Long/Lat numbers???
    Any suggestions???
    And again Thanks for the response!

  • Calculating the Size(KB) in the explain plan....

    Hi
    I executed a sql statement in SQL*PLUS and having enabled the tracing in OEM , among others , I read the Size in KiloBytes which the 'TABLE ACCESS FULL' segment of the explain plan returned.....
    This number is 5.998,193KB
    I used the vsize built-in function in order to get the total number in bytes of the physical representation of all the rows (about 53500) ....
    So , I wrote :
    select nvl(sum(vsize(farmak_code)),0)+nvl(sum(vsize(emp_name)),0)+nvl(sum(vsize(category)),0)+ .....+.....
    from mitroo_farmakou
    The result was 5794544 in bytes which is close to 5.998,193KB.
    My question is :
    The computation of the bytes in the explain plan (TABLE ACCESS FULL segment) is done by adding the vsize of all columns....????
    Does anybody Knows...????
    Thanks , a lot
    Simon

    I doubt it. For a large table that would be an incredibly expensive calculation.
    I suspect that it is something closer to:
    SQL> SELECT * FROM incident;
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=137 Card=15603 Bytes=6818511)
       1    0   TABLE ACCESS (FULL) OF 'INCIDENT' (Cost=137 Card=15603 Bytes=6818511)
    SQL> SELECT ROUND(num_rows * avg_row_len)
      2  FROM user_tables
      3  WHERE table_name = 'INCIDENT';
    ROUND(NUM_ROWS*AVG_ROW_LEN)
                        6818449HTH
    John

  • In snow leopard, you could see the size of each file. Is this the case for os lion?each file

    In Snow Leopard, you could see the size of the file which was shown at the bottom of the file. This does not appear to be the case with OS Lion. Am I wrong? Thank you for your help.

    If you're referring to desktop icons, right click on the desktop > Show view options > check "show item information".

  • Change the size of a Column in a Table

    I have a JTable with two columns but I don't know how to change the size of the columns
    Thanks.

    Hi,
    You have to use TableColumn and use JTable.setPreferredSize() method to size ur Columns.
    Hope this helps.
    Cheers
    SS

  • Find the size of a blob in a table

    Hi,
    I have a table with a blob type column,
    How to find the size of the blob in one specific row ?
    Can it be done through a Select query ?
    Thanks.

    Dear A-K!
    Please have a look at the following example:
    conn pm/pm
    desc print_media
    SELECT dbms_lob.getlength(ad_photo)
    FROM print_media;this example is from [http://www.psoug.org/reference/dbms_lob.html].
    Yours sincerely
    Florian W.

Maybe you are looking for

  • B1 with SQL Server 2008 and SEC with SQL Server 2005

    Hi, we are currently upgrading from B1 2005 to B1 2007. With B1 2007 we could use MS SQL Server 2008. In parallel we have a SEC implementation (which uses SQL Server 2005). Would there be any issues with the integration of B1 and SEC although they ru

  • Export music from windows phone to iPad and iPhone!

    How do you export music to a iPad mini from a htc radar windows 7.5?

  • How much is my iMac worth

    Hello, I am planning on buying a new iMac so I'm wondering how much should I sell my iMac for? Full Specs List Name: iMac (21.5-inch, Mid 2011) Processor: 2.5 GHz Intel Core i5 RAM Memory: 8 GB 1333 MHz DDR3 4x2GB Graphics Card: AMD Radeon HD 6750M 5

  • Is there PDF convert to MS Office app for business available?

    Is there PDF convert to MS Office app for business available?

  • Slideshows in Aperture 3

    Folks, Two quick questions.  When making a slideshow in aperture 3 how can I get the program to just put my photos in a Random order?  I don't want to manually move them around.  Also, what would you say is the best software for creating energetic mu