Database much larger than expected when using secondary databases

Hi Guys,
When I load data into my database it is much larger than I expect it to be when I turn on secondary indexes. I am using the Base API.
I am persisting (using TupleBindings) the following data type:
A Key of size ~ *80 Bytes*
A Value consisting of 4 longs ~ 4*8= *32 Bytes*
I am persisting ~ *280k* of such records
I therefore expect ballpark 280k * (80+32) Bytes ~ *31M* of data to be persisted. I actually see ~ *40M* - which is fine.
Now, when I add 4 secondary database indexes - on the 4 long values - I would expect to see approximately an additional 4 * 32 * 280k Bytes -> ~ *35M*
This would bring the total amount of data to (40M + 35M) ~ *75M*
(although I would expect less given that many of the secondary keys are duplicates)
What I am seeing however is *153M*
Given that no other data is persisted that could account for this, is this what you would expect to see?
Is there any way to account for the extra unexpected 75M of data?
Thanks,
Joel
Edited by: JoelH on 10-Feb-2010 10:59
Edited by: JoelH on 10-Feb-2010 10:59

Hi Joel,
Now, when I add 4 secondary database indexes - on the 4 long values - I would expect to see approximately an additional 4 * 32 * 280k Bytes -> ~ 35MA secondary index consists of a regular JE database containing key-value pairs, where the key of the pair is the secondary key and the value of the pair is the primary key. Your primary key is 80 bytes, so this would be 4 * (4 + 80) * 280k Bytes -> ~ 91M.
The remaining space is taken by per-record overhead for every primary and secondary record, plus the index of keys itself. There are (280k * 5) records total. Duplicates do not take less space.
I assume this is an insert-only test, and therefore the log should contain little obsolete data. To be sure, please run the DbSpace utility.
Does this answer your question?
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Hard drive sounds louder than expected when using a wacom bamboo tablet

    i hace been trying to do some illustration work in photoshop CS5 using a wacom bamboo pen tablet
    however as stated this seems to make the hardrive work louder then expected and i am worried that i could over heat and break my mac if i continue to work like this,
    i dont even run any other programs well working (eg; safari or i-tunes)
    i'm wondering if it is because my mac dosent have enough RAM to work both photoshop and the tablet at the same time and that if i add extra this would solve the problem
    the tablet is powerd through a usb port

    um i dont know how much ram it has ,but i havent added any yet so what it came with is the best answer i can give to that (sorry)
    how loud would the fan sound as the noise i'm getting is a loud hum that starts up after a couple of
    minuets of using my tablet and then goes away if i stop

  • Help with Photoshop CS2 files MUCH larger than normal, possibly not compessing layer masks

    Has anyone else come across a problem where Photoshop files grow in size much faster than expected, especially when adding layer masks?
    Normally when you add a layer mask the file size grow a small amount if the layer mask is mostly all white or mostly all black. In this case it's like the file size is growing exponentially, almost as if the layer mask isn't being compressed at all.
    The file in question although large, is similar dimensions, resolution, and number of layers as other projects that have been worked on and all the usual thing have been checked like resolution, colour mode, bit depth and the image has also been cropped so there's nothing outside of the page.
    The file has been checked on 2 different macs and exhibits the same behaviour and Photoshop preferences have been deleted and re-created and we've tried copying the file by dragging layers to a new document of the same dimensions with no success.
    The only things we're certain of is that file size grows dramatically when adding layer masks in particular and layers in general.
    The file was created by someone else, if that might be a factor, though the file has been "saved as.." with no improvement.
    Any ideas?
    TIA
    Tom
    The only

    Maybe it has something to do with "Maximize Compatibility". If that's checked when you save, it might add a lot of weight to your file, even with just a simple layer mask. Don't know, haven't done any testing, just a thought.
    Edit: Just did a quick test:
    1. flat image saved as PSD = 5.2 MB
    2. same image converted to a layer with simple layer mask, saved as PSD = 5.8 MB
    3. same layer mask image saved WITH "maximize compatibility" = 10.7 MB
    So adding "maximize compatibility" nearly doubled this test file. Could be it?

  • Why is menu size so much larger than the files?

    I am somewhat perplexed - I'm making a single-layer dvd and have a simple single screen theme (no animation) - it has one drop zone. The movie has 28 chapters so there are five of them, but so far I've added only one montage of photos to each menu page - it's a "mobile" quality in media browser and ave only 10 - 20 MB, then one song. On average these movie clips are 1:00 to 2:00 min long and the music is cut to that length. So, all told, it's probably less than 110 MB in files - but when I look at the project properties, the menus are 3301 MB!!!
    The movie itself is only 1.1 GB so what is going on?
    It's preventing me from doing the project and I've got no idea why it's making the menu size so much larger than the file sizes?
    Can you please help me figure out what to do?
    Alexa

    The 2 min clips were natively 2 min - I had each one separate and actually converted to media browser in "mobile" size (b/c the drop zone was 4 x 6 in size in the theme). They were tiny - in most cases I was shortening the audio (e.g. the song was 4 minutes and I was setting the loop to only 1:30 b/c that's how long the video clip was on the menu).
    BUT, to resolve the question (I always like to post the answer) - I ended up duplicating the project to try to reimport the video. It was a fresh iDVD project and I happened to click on the project tree of screens - and, lo and behold, the ENTIRE menu was duplicated for some reason (and the movie, actually). I went back to the original and it was the same! I have no idea how that would happen do you? It only had one main menu screen - and then an entire duplicate menu - which I wouldn't even know how to access if I didn't see it in the project menu tree?
    The only think of is that at one point I added a title menu link to the scene selection - it gave me a warning that my menu was more than 12 minutes, did I want to fix or ignore and fix later - which confused me b/c it was under 12 min, then but I clicked ignore. Does that create an alternate title menu and send people back to something else?
    Anyway, I deleted the entire extra scene selection menus (5 of them) and it was back to under 4 GB.
    So, I was able to burn, but still wondering about creating the "title menu" link on scene selections? It drives me crazy that it doesn't automatically do that so I like to add "main menu" links.
    Thanks for your help!
    Alexa

  • Email account folder in /user/library/mail is much larger than full mailbox archive for the same account

    Hi,
    I recently changed jobs and want to archive all email (with attachments in place) for the associated work email account.  I also plan to remove the old work email account (IMAP) from the list of active mailboxes in Apple Mail.  I don't want Spotlight searches for personal or current work email cluttered with results from my old job.
    I have created an archive of the old work account by doing Mailbox Archive for all of the IMAP folders for that account.  The entire archive is 1.7GB in size.
    Before I delete the old account from my Mail preferences, I want to make sure that I have really exported everything.  So I've compared the size of the new archive folder with that of the mailbox folder in users/.../Library/Mail for that same account.  That latter is 8.7GB in size.  Why the enormous difference?
    Can the difference be attributed to lack of compression and indices (which would be rebuilt if I import the archive) for spotlight searches?  Am I missing something in the archive that I created?
    I've created a zip of the system folder.  Can I easily restore this at a latter time if I delete the email account from my Mail preferences?
    Is there a better way to achieve my objective?
    Mitoids

    I did find a "Recovered Messages" by looking in the the Mail client under "On My Mac" (I don't normally use that feature).  One message with an accicental 99MB attachment that I never sent, was recovered ~60times, consuming 5.7GB. 
    I deleted all of those, but the size ~/Library/Mail/xxxaccount folder did not change much.  It is still much larger than the Archive I created.  BTW, this is an IMAP account that was syncing with corporate GMail.

  • I recently moved all of my photos from one portable drive to a new and much larger one. I use LR 5 and and all of the folders now have a ? in their folder icon. The thumbnail is there but no actual photo. How do i reconnect them?

    i recently moved all of my photos from one portable drive to a new and much larger one. I use LR 5 and and all of the folders now have a ? in their folder icon. The thumbnail is there but no actual photo. How do i reconnect them?
    Jim Boehme
    [email protected]

    Duplicate post
    see the answer at your earlier post LR 5

  • When using Appleworks database for printing labels can I have columns of different widths?

    When using Appleworks database for printing labels can I have a column of different width?
    Case in point, the supplied avery labels in Appleworks does not have 8195. When I build one using custom design  I need a small column between column 2 and 3 to line up the info in columns 3 and 4. All the labels are 1.3/4 inch wide but I need to insert a column 1/4 wide to match up with the avery page....
    Any ideas???    
    Thanks......
    ---warren

    Well, the issue is that when you creat a custom width of 1.3/4 from the edge of the first label to the edge of label 2 all is good. The right and left margins were also set correct in AW. The Avery page, for some reason, has a small 1/4 inch column between the columns of label 2 and 3 therefore making the distance between the left edge of the label in column 2 and the right edge of the label in column 3 - a width of 2 inches and not 1.3/4.
    I guess Avery wanted the page to look even.
    I did this work around.....
    I created a custom lay out of 2 columns (not 4) with the correct width of 1.3/4 from label edge to label edge and the correct left side margin. After printing the first page I just turned the sheet 180 degress and printed the 2nd page to use all the labels on the Avery sheet. Since the upper and lower margin were the same it worked great....
    "Great minds think alike"...   thanks for your suggetion

  • My hard drive is clogging up automatically. The personal folder is now 921 GB which is much larger than the sum of the subfolders. I cannot see what's causing this or prevent this from happening. Anyone?

    My hard drive on my Imac keeps clogging up automatically. The personal folder is now 925 GB which is much larger than the sum of the underlying subfolders. I cannot see what"s causing this. Anyone?

    You may try one of these utilities to spotlight exactly where the hard drive usage has gone crazy.
          DaisyDisk- http://itunes.apple.com/us/app/daisydisk/id411643860?mt=12
         DiskFalcon   - http://itunes.apple.com/us/app/disk-falcon/id421781596?mt=12
    Items to check manually:
         Duplicate iTune libraries, or music files that are in itune folder AND loose on the harddrive
         Download folder that hasn't been emptied
         Backup software location

  • What problems to expect when using qmsolb65?

    Hi,
    What problems can I expect when using qmsolb65.olb with designer 6i and still use qmsevh50, qmslib50 and templates of designer 6.0? Do I need to upgrade the templates as well?
    The libraries qmsevh50 and qmslib50 can not be upgraded due to the fact that the customer has added and altered some functionality in these libraries.
    Please, I need answers in short term as the project is fixed date.
    Best regards,
    Pascal

    Pascal,
    The Headstart 6i Migration Guide, Chapter 5 Incremental Upgrade provides some detailed information on what exactly has changed between version 5.0 and 6.5. I think you might be able to use the qms*50.pll libraries with 6i, but I doubt you will be able to use the templates of Designer 6.0 with qmsolb65.olb.
    Cheers,
    Rob

  • Why are my icons larger than normal when I turn on phone?

    Why are the icons larger than normal when turning on phone? How can I resize them back to normal?

    Double-tap the screen with THREE fingers. Then go to Settings/General/accessibility and turn off Zoom.

  • I have an iphone 4s and when I try to connect it to my shared libraries; I get an icon of a circle that only fills up halfway.  I have an ipad and it connects to the shared library without a problem.  My library is much larger than the capacity of either

    I have an iphone 4s and when I try to connect to my shared library I see an icon of a circle that only becomes half full.  It does not connect.  I also have an ipad, which connects without incident. My itunes library is larger than the capacity of both devices, so that cannot be the issue.  How can I get the phone to connect with my shared library?

    My husband and I are using the same iTunes account on all mac & pc computers, but the libraries are different on each machine.  We always manually manage our music (no auto sync).  iTunes is up to date on the PCs.  My husband uses our joint iTunes account on his pc, but once again, has a different collection in his library from those on the other machines.  He can't load any music from his PC to his iphone 4.  I can load music from my mac library to my iphone 4s, but cannot load from my pc library to my iphone 4s.  How can I switch my main library that it syncs with from the mac to the pc?
    Thanks

  • My jpeg file sizes are much larger than they used to be.

    Just recently the file sizes on my .jpeg files have become excessively larger than they used to be just a week or so ago. Where I used to go almost a week to need to archive to DVD a bunch of saved images, I've now got to save to DVD almost daily.
    For example, a 300x300 pixel image which shoud be about 32 Kb reads 383 Kb in the finder. I'm not doing anything to these images, just draging and droping.
    Where I used to get 7 K files on a DVD, I'm now getting less than 2 K files to each disc.
    Any thoughts on what's changed and how to fix it?

    What App & JPEG compression rating are you using, some apps can reduce file size by dropping colors for instance...

  • Using the Premiere pro CC 2014 exported media file size is much larger than estimate, also is so much bigger than Premiere CS 6?

    I used the preset H,264 Youtube 1080HD to export a video. The estimate size is 7308 MB {after I reduce the nitrate). The final size is 11.18 GB.
    Why is so much different? Befor I Use the Premiere CS6 to export a simial size use the same format Is around 6GB.

    First of all, the estimated file size just an estimate based chiefly on the combination of the bitrate and duration. The actual size can vary significantly, depending in large part on the amount of change from frame to frame throughout the video. For example, if you encode two clips of identical duration to exactly the same settings, the only difference being the nature of the content--say on is a talking head interview shot with the camera locked down on a tripod while the other is skateboarding footage that was shot handheld--the size of two resulting outputs files will be widely divergent.
    As to the comparison between CS6 and CC2014, note that the settings for some presets have been changed. For instance, the h.264 YouTube 1080 presets went from 8Mbps to 16.

  • Problem using secondary database, sequence (and custom tuple binding)

    I get an exception when I try to open a Sequence to a database that has a custom tuple binding and a secondary database. I have a guess what the issue is (below), but it boils down to my custom tuple-binding being invoked when opening the sequence. Here is the exception:
    java.lang.IndexOutOfBoundsException
    at com.sleepycat.bind.tuple.TupleInput.readUnsignedInt(TupleInput.java:4
    14)
    at com.sleepycat.bind.tuple.TupleInput.readInt(TupleInput.java:233)
    at COM.shopsidekick.db.community.Shop_URLTupleBinding.entryToObject(Shop
    _URLTupleBinding.java:72)
    at com.sleepycat.bind.tuple.TupleBinding.entryToObject(TupleBinding.java
    :73)
    at COM.tagster.db.community.SecondaryURLKeyCreator.createSecondaryKey(Se
    condaryURLKeyCreator.java:38)
    at com.sleepycat.je.SecondaryDatabase.updateSecondary(SecondaryDatabase.
    java:546)
    at com.sleepycat.je.SecondaryTrigger.databaseUpdated(SecondaryTrigger.ja
    va:42)
    at com.sleepycat.je.Database.notifyTriggers(Database.java:1343)
    at com.sleepycat.je.Cursor.putInternal(Cursor.java:770)
    at com.sleepycat.je.Cursor.putNoOverwrite(Cursor.java:352)
    at com.sleepycat.je.Sequence.<init>(Sequence.java:139)
    at com.sleepycat.je.Database.openSequence(Database.java:332)
    Here is my code:
    // URL ID DB
    DatabaseConfig urlDBConfig = new DatabaseConfig();
    urlDBConfig.setAllowCreate(true);
    urlDBConfig.setReadOnly(false);
    urlDBConfig.setTransactional(true);
    urlDBConfig.setSortedDuplicates(false); // No sorted duplicates (can't have them with a secondary DB)
    mURLDatabase = mDBEnv.openDatabase(txn, "URLDatabase", urlDBConfig);
    // Reverse URL lookup DB table
    SecondaryConfig secondaryURLDBConfig = new SecondaryConfig();
    secondaryURLDBConfig.setAllowCreate(true);
    secondaryURLDBConfig.setReadOnly(false);
    secondaryURLDBConfig.setTransactional(true);
    TupleBinding urlTupleBinding = DataHelper.instance().createURLTupleBinding();
    SecondaryURLKeyCreator secondaryURLKeyCreator = new SecondaryURLKeyCreator(urlTupleBinding);
    secondaryURLDBConfig.setKeyCreator(secondaryURLKeyCreator);
    mReverseLookpupURLDatabase = mDBEnv.openSecondaryDatabase(txn, "SecondaryURLDatabase", mURLDatabase, secondaryURLDBConfig);
    // Open the URL ID sequence
    SequenceConfig urlIDSequenceConfig = new SequenceConfig();
    urlIDSequenceConfig.setAllowCreate(true);
    urlIDSequenceConfig.setInitialValue(1);
    mURLSequence = mURLDatabase.openSequence(txn, new DatabaseEntry(URLID_SEQUENCE_NAME.getBytes("UTF-8")), urlIDSequenceConfig);
    My secondary key creator class looks like this:
    public class SecondaryURLKeyCreator implements SecondaryKeyCreator {
    // Member variables
    private TupleBinding mTupleBinding; // The tuple binding
    * Constructor.
    public SecondaryURLKeyCreator(TupleBinding iTupleBinding) {
    mTupleBinding = iTupleBinding;
    * Create the secondary key.
    public boolean createSecondaryKey(SecondaryDatabase iSecDB, DatabaseEntry iKeyEntry, DatabaseEntry iDataEntry, DatabaseEntry oResultEntry) {
    try {
    URLData urlData = (URLData)mTupleBinding.entryToObject(iDataEntry);
    String URL = urlData.getURL();
    oResultEntry.setData(URL.getBytes("UTF-8"));
    catch (IOException willNeverOccur) {
    // Success
    return(true);
    I think I understand what is going on, and I only noticed it now because I added more fields to my custom data (and tuple binding):
    com.sleepycat.je.Sequence.java line 139 (version 3.2.44) does this:
    status = cursor.putNoOverwrite(key, makeData());
    makeData creates a byte array of size MAX_DATA_SIZE (50 bytes) -- which has nothing to do with my custom data.
    The trigger causes an call to SecondaryDatable.updateSecondary(...) to the secondary DB.
    updateSecondary calls createSecondaryKey in my SecondaryKeyCreator, which calls entityToObject() in my tuple-binding, which calls TupleInput.readString(), etc to match my custom data. Since what is being read goes for more than the byte array of size 50, I get the exception.
    I didn't notice before because my custom tuple binding used to read fewer that 50 bytes.
    I think the problem is that my tuple binding is being invoked at all at this point -- opening a sequence -- since there is no data on which it can act.

    Hi,
    It looks like you're making a common mistake with sequences which is to store the sequence itself in a database that is also used for application data. The sequence should normally be stored in separate database to prevent configuration conflicts and actual data conflicts between the sequence record and the application records.
    I suggest that you create another database whose only purpose is to hold the sequence record. This database will contain only a single record -- the sequence. If you have more than one sequence, storing all sequences in the same database makes sense and is safe.
    The database used for storing sequences should not normally have any associated secondary databases and should not be configured for duplicates.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When using the Database Connectivity Toolset, reads and writes with long binary fields are incompatible.

    I am trying to write LabVIEW Variants to long binary fields in a .mdb file using the Database Connectivity Toolset. I get errors when trying to convert the field back to a variant after reading it back from the database.
    I next tried flattening the variant before writing it and ultimately wound up doing the following experiments:
    1) If I use DB Tools Insert Data to write an ordinary string and read it back using a DB Tools Select Data, the string is converted from ASCII to Unicode.
    2) If I use DB Tools Create Parameterized Query to do an INSERT INTO or an UPDATE operation, specifying that the data is BINARY, then read it back using a DB Tools Select Data,
    the length of the string is prepended to the string itself as a big-endian four-byte integer.
    I can't think of any way to do a parameterized read, although the mechanism exists to return data via parameters.
    Presuming that this same problem affects Variants when they are written to the database and read back, I could see why I get an error. At least with flattened strings I have the option of discarding the length bytes from the beginning of the string.
    Am I missing something here?

    David,
    You've missed the point. When a data item is flattened to a string, the first four bytes of the string are expected to be the total length of the string in big-endian binary format. What is happening here is that preceding this four-byte length code is another copy of the same four bytes. If an ordinary string, "abcdefg" is used in place of the flattened data item, it will come back as <00><00><00><07>abcdefg. Here I've used to represent a byte in hexadecimal notation. This problem has nothing to do with flattening and unflattening data items. It has only to do with the data channel consisting of writing to and reading from the database.
    I am attaching three files that you can use to demonstrate the problem. The VI file c
    ontains an explanation of the problem and instructions for installing and operating the demonstration.
    Ron Martin
    Attachments:
    TestLongBinaryFields.vi ‏132 KB
    Sample.UDL ‏1 KB
    Sample.mdb ‏120 KB

Maybe you are looking for

  • Video transfer from Lumia 520 to PC

    How do I transfer video files from my Lumia 520 onto my computer without a cable or what do I do after uploading on Skydrive ?

  • 10.2.0.1 on AIX5L-64bit

    Hi, Installing on 10.2.0.1 on AIX5L-64 bit, there are other Oracle dbs running on different homes, but this one is a new one, nothing is running underneath. When trying to install, giving: Checking swap space: 0 MB available, 150 MB required. Failed

  • Data security with iPhone sync to First Class over Rogers network

    I manage about 20 iPhones over the Rogers network in Southern Ontario. We use them to sync Contact and Calendar info to our First Class email system and to collect email via an IMAP connection to First Class. I've got some users concerned about data

  • Suggestions needed in a huge bulk delete operation

    Hi , I have the following scenario. begin open c1; fetch c1 bulk collect into L_item ; cursor fetch -- 20,000(x) rows forall i in 1..L_item.count delete tab7 where col1= L_item(i); delete 900*x rows forall i in 1..L_item.count delete tab1 where item

  • File saving error : write access not granted

    working on some old images annd when I try to save get a message---write access was not granted---- what is that ?