Speed of random key access

hi,
we have a bdb with around 1 million entries in it. keys are small (~20 bytes), values are large (~2k). i was just wondering if there are any strategies for optimizing random key access. basically, we run operations where we end up with a collection of keys (say 20), which we then iterate through, retrieving each entry. is there any strategy for optimizing this? (e.g. sorting keys in the same order as the database.)
thanks,
-james

Hi James,
Sorting keys certainly won't hurt, but unless there's a good chance of locality of some of the keys you'll still hit random spots on the disk. If keys are sorted in insertion order, then it's likely that there will be locality. Alternatively, if you can sort to insertion order (if insertion order != key order), that might work too. Again, it depends on the proximity of the keys in your 20-key set.
But a more fundamental question is whether you can just allocate a large enough cache to fit the entire database in memory. You can load the entire database using Database.preload(); If you can't increase the cache size, then you could try cleaning the log to a smaller size. This increases the likelihood of hits in the file system cache. But cleaning to a higher minUtilization is also expensive.
Regards,
Charles Lamb

Similar Messages

  • Random keys on keyboard malfunction.

    Its been about three days since the problem first presented itself. Using my USB keyboard random keys such as ", w,3, num lock 5 key, capital p, and the right arrow key. I am using the on-screen keyboard to help me write this post.
    Things I have tried (according to research via google):
    Trying a different keyboard. Same problem, temporary fix for roughly thirty minutes.
    Trying a different USB port (front and back). Failed.
    Uninstalling keyboards on device manager. Rebooting, failed.
    Ease of access, keyboard shortcuts, sticky keys, filters. All of that now unchecked and failed.
    Turning computer off, holding power button down for 10 seconds
    Computer specs:
    Windows 7 Home premium 64 bit.
    AMD phenom II X4 945 Processor
    8GB RAM
    AMD RADEON HD 5450
    Keyboard: Steelseries Shift
    Mouse: Razer Deathadder
    Sidenote/story: I modified my Razer Deathadders lights on the razer logo and scrollwheel to have them off. As soon as I turned them back on my keyboard started working just fine. Then shortly after five minutes it went back to having problems.

    Because you mentioned in the sidenote/story that you adjusted the settings for your Razer Deathadder and had success for a few minutes,  have you thought to, perhaps, uninstall the software to see if the issue goes away permanently?  I don't know of any reason that it would have conflicts with anything else on your computer, but it might be an interesting troubleshooting step to try.  Other than that suggestion, I wouldn't know where to go with this...
    Good luck, I wish you the best with this.
    GeorgeFN
    I work on behalf of HP.

  • IPhoto 9.3 - all EVENTS out of order, random key photos, some empty.

    Since iPhoto 9.3 update, all Events folders at top of Source List are showing correctly as thumbnails - correct order (manual), key photos - no probs. But they're also further down the S'List, under another EVENTS, this time out of order. When I go to full screen view to access ALBUMS thumbnails, the Events are above them, looking like Albums (stack of white framed photos), in random order, with random key photos, and some are empty. Also, on this view only, scrolling is not working properly.

    I have had the same problem... not to mention I made it worse trying to reset my manual settings for iphoto!!!!
    Now all of my stuff on my comupter is out of order!! : ( It will take me months to fix this. I often use iphoto on my ipad for work and it looks like that is not going to happen now!
    I am very unhappy about this apple people!
    DPM

  • Simulate that i hold an random Key.

    Hey,
    i just oponend an discussion for an long time ago and marked those as solved, but ihe advice from User called Melophage doesn't helps.
    "Hey Guys,
    i just want to generate an Caps Lock Function for my Option Key, cause of my handicap i couldn't hold this Key anytime.
    Any Suggestions or advices to fix my problem as soon as possible.
    Thanks in advance.
    n1mare.!
    n1mare,
    KeyRemap4MacBook will allow you to set either Option key (or both Option keys) to act as a Caps Lock."
    Hi Melophage,
    i just need to correct my reply. It doesn't works. I don't want to act with my option keys as Caps lock. I just want to simulate, that i hold those Keys. (for example Shift_L & Option_R)
    Hopefully my explanations are understandable and you could help soon as possible.
    Many Thanks.
    n1mare.
    Message was edited by: n1mare

    n1mare,
    if you still have KeyRemap4MacBook installed, you can set up a “Control Lock” function through e.g. checking the “▼ Change Control_L Key (Left Control) → Control_L to Sticky Control_L” checkbox — this would turn the left Control key into a Control Lock key.
    Alternatively, you could open the Accessibility pane of System Preferences, select Keyboard on the left-hand side, and then check the “Enable Sticky Keys” checkbox to have all of your modifier keys act as Lock versions. If you choose this option, then I’d recommend also checking the “Show Accessibility status in menu bar” checkbox.
    I don’t know of any program that will set a random key to be a Lock key — the choices in KeyRemap4MacBook are all for specific keys, not for making one random selection out of all of the keys.

  • I am trying to update my itunes and iphone. Everytime I trie comes out a message about 'key access'. I've done all the steps from the support and nothing worked out. I cannot unistall and now I can't open it anymore also. What should i do, please?

    I am trying to update my itunes and iphone. Everytime I trie comes out a message about 'key access'. I've done all the steps from the support and nothing worked out. I cannot unistall and now I can't open it anymore also. What should i do, please?

    Isn't that only used when a PC will not boot?
    What options does booting with this give me?
    Thanks
    JK MCP
    Hi,
    USB recovery disk was used to recover your system when it encounter problem. You can try to use it to fix your problem instead reinstall system. However, there is no method to keep your program whenreinstall system.
    Roger Lu
    TechNet Community Support

  • Sequential vs random disc access - is LR more of one than the other?

    I'm deciding on a new build for photoediting and based on what I've read will be going with some SSD drives (one for OS/apps, one for the LR catalog, cache, previews and LR/PS work area). Edited photos will be taken off the SSD for long term storage on HDD.
    Technical reviews on SSDs discuss their capabilities primarily in terms of random versus sequential read/writes.
    I understand that LR (and PS) make use of a mixture of random and sequential read/writes. Obviously applying a keyword to 35 separate images is going to be a random write operation, whereas generating a 1:1 preview in Develop seems to me more likely to involve sequential read/write.
    My question is this: under "normal" use (and I accept that there really is no such thing, but I am talking about what I expect the vast majority of users find themselves doing on a daily basis i.e. importing RAW captures, applying metadata, developing and printing), what would be the best way to describe LRs use of a hard disc? On the whole, is there more sequential or random disc access going on? More reading or writing?
    Thanks to any bright spark out there who can illuminate me...I've found it difficult to get a handle on this from the net.
    Dave M

    Lee Jay, random catalog and images sequential seems to fit with what I would imagine is the case but as clvrmnky points out there can be alot going on at the controller level too.
    Clvrmnky agree one can't generalize (in fact that's my concern about one user being only one data point), and your comments re good media, backups etc. are all good pieces of advice (as it happens ones that I took on board many years ago but still valuable to repeat in fora like this again and again).
    You do suggest keeping the ACR cache and LR catalogue on separate discs however. I had planned on keeping them on a 256 GB Crucial C300 SSD drive. What would be the advantage of keeping them on separate drives?

  • Random error accessing CIFS shares from Windows

    I am setting up some CIFS shares to be used from Windows clients and in the process I had some random problems accessing the shares.
    In hope of finding the answer I checked the CIFS Service and the Active Directory Service, and while watching the screen for Active Directory Service I saw that the "Selected Domain Controller" changed from one to another. I now stayed within this screen and noticed that the "Selected Domain Controller" continued to change and then I found the problem, because an unknown Domain Controller appeared. The IP was 216.150.17.8
    I found that when ever this Domain Controller was the selected one, all access to CIFS shares from Windows clients failed! This is correct, because the 216.150.17.8 of course is unaware of all users in Our Domain
    So the Questions are:
    - what is happening?
    - and how to solve this?
    - why is a Domain Controller 216.150.17.8 sometimes the Selected Controller?
    - where does this 216.150.17.8 come from?
    Have You seen anything like this?

    I now have found out why the DC changes - it is because the CIFS service is restarting ;-(
    This is a log snip
    2009-5-14 09:24:53 Executing start method ("exec /usr/lib/smbsrv/smbd start").
    2009-5-14 09:24:53 Executing stop method (:kill).
    2009-5-14 09:24:53 Stopping because all processes in service exited.
    2009-5-14 09:24:39 Method "start" exited with status 0.
    2009-5-14 09:23:48 Executing start method ("exec /usr/lib/smbsrv/smbd start").
    smbd: NetBIOS services started
    2009-5-14 09:23:48 Executing stop method (:kill).
    2009-5-14 09:23:48 Stopping because all processes in service exited.
    2009-5-14 09:23:34 Method "start" exited with status 0.
    It seems to happen when I access the share and thereby force a uservalidation
    Any ideas?

  • Modify to not use a random key

    Can anyone help me modify this program so it doesn't use a random key? I want to decrypt the password in another program, so I don't want to have to read a key file.
    I've seen some forums posts doing something similar, but so far I haven't been able to successfully change mine. I don't think it would take much.
    Anyway, any help is appreciated.
    James
    Here's the Encrypt code:
    import java.io.*;
    import java.security.*;
    import javax.crypto.*;
    import sun.misc.*;
    public class EncryptPassword
         public static void main(String args[]) throws Exception
              if(args.length<1)
                   System.out.println("Usage : EncryptPassword text");
                   return;
              Security.addProvider(new com.sun.crypto.provider.SunJCE());
              Key key;
              try
                   ObjectInputStream in=new ObjectInputStream(new FileInputStream("des.key"));
                   key=(Key)in.readObject();
                   in.close();
              }      catch(FileNotFoundException fnfe)
                        KeyGenerator generator= KeyGenerator.getInstance("DES");
                        generator.init(new SecureRandom() );
                        key=generator.generateKey();
                        ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("des.key"));
                        out.writeObject(key);
                        out.close();
              Cipher cipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
              cipher.init(Cipher.ENCRYPT_MODE,key);
              String amalgam=args[0];
              for(int i=2;i<args.length;i++)
              amalgam+=" "+args;
              byte[] stringBytes=amalgam.getBytes("UTF8");
              byte[] raw=cipher.doFinal(stringBytes);
              BASE64Encoder encoder = new BASE64Encoder();
              String base64 = encoder.encode(raw);
              System.out.println(base64);
    Decrypt code:
    import java.io.*;
    import java.security.*;
    import javax.crypto.*;
    import sun.misc.*;
    public class DecryptPassword
         public static void main(String args[]) throws Exception
              if(args.length<1)
                   System.out.println("Usage : DecryptPassword text");
                   return;
              Security.addProvider(new com.sun.crypto.provider.SunJCE());
              Key key;
              try
                   ObjectInputStream in=new ObjectInputStream(new FileInputStream("des.key"));
                   key=(Key)in.readObject();
                   in.close();
              }      catch(FileNotFoundException fnfe)
                        KeyGenerator generator= KeyGenerator.getInstance("DES");
                        generator.init(new SecureRandom() );
                        key=generator.generateKey();
                        ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("des.key"));
                        out.writeObject(key);
                        out.close();
              Cipher cipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
                   cipher.init(Cipher.DECRYPT_MODE,key);
                   BASE64Decoder decoder = new BASE64Decoder();
                   byte[] raw = decoder.decodeBuffer(args[0]);
                   byte[] stringBytes = cipher.doFinal(raw);
                   String result = new String(stringBytes,"UTF8");
                   System.out.println(result);
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I get errors when I'm trying to use the sample code you sent. What else do I need to import to use DESKeySpec? I tried import javax.crypto.spec.DESKeySpec.*;
    When I try to compile I get this:
    C:\Temp\Java>javac EncryptPassword.java
    EncryptPassword.java:41: cannot resolve symbol
    symbol : class DESKeySpec
    location: class EncryptPassword
    DESKeySpec ks = new DESKeySpec(new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF });
    ^
    EncryptPassword.java:41: cannot resolve symbol
    symbol : class DESKeySpec
    location: class EncryptPassword
    DESKeySpec ks = new DESKeySpec(new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF });
    ^
    EncryptPassword.java:41: possible loss of precision
    found : int
    required: byte
    DESKeySpec ks = new DESKeySpec(new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF });
    ^
    EncryptPassword.java:41: possible loss of precision
    found : int
    required: byte
    DESKeySpec ks = new DESKeySpec(new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF });
    ^
    EncryptPassword.java:41: possible loss of precision
    found : int
    required: byte
    DESKeySpec ks = new DESKeySpec(new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF });
    ^
    EncryptPassword.java:41: possible loss of precision
    found : int
    required: byte
    DESKeySpec ks = new DESKeySpec(new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF });
    ^
    6 errors
    Thanks,
    James

  • When I shut the lid to my computer and then open it again the screen comes on and then goes black and I have to press random keys to make it show again.  Does anyone know why this is happening?

    When I close my lid to make the computer sleep and I open it back up again when I am ready to use it the screen turns on and then turns black.  I have to press random keys to make the screen show again.  Any help is greatly appreciated!

    First, before you sleep your MBP, make sure you either scroll down the Apple menu to sleep your machine, or do it even more easily by pressing CMD-OPTION - DiskDrive (upper right hand corner of your keyboard). I wouldn't just close your machine to let it sleep.
    It's hard to know exactly what's happening, but here are a few pointers.
    1. Go to System Preferences/Energy Saver and make sure you've set a sleep time of more than two or three minutes. Your machine may be trying to sleep too early. In the same preferences, set Computer Sleep to more than ten minutes, to make sure you don't get an unintentional sleep.
    2. Take a look for third-party applications you might have installed.
    Post here with your results!

  • Resetting,disabling.Clean-ups and Frag, just dosen't boot my pc any faster, any tips and what speeds it yup for accessing aother websites andtheir sites

    Tried resetting,disabling,clean-ups, defrag, changing proxy to 'No Proxy' even doing a number 20 in the DOM etc just doesn't boot my PC any faster or enable me to access my own website pages/sites a recent development, just keeps Turning around without loading the dashboard, though brings up webpage like with yahoo, but takes an awful long time in the morning to get to my email,, same as when booting up from closed; any tips and what speeds it up for accessing another websites and their sites edit;; getting fed up with Firefox,, much to problematic,, any ideas who has less problematic Browser. many thanks,
    N.B, My PC is a an Windows Xp, the latest

    Usually slowness after one upgrade requires disabling hardware acceleration, or a possible new regression (hopefully not).
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    * Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    * In the Firefox options window click the Advanced tab, then select "General".
    * In the settings list, you should find the Use hardware acceleration when available checkbox. Uncheck this checkbox.
    * Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]

  • Reading a record by key access.

    Hi Gurus,
               In 'read table' for reading a record by key access they have used 'comparing' , 'transporting' , 'assigning'.
    Can you please explain me what exactly the above will happen with an clear example.
    Thanks,
    Prabu S.

    mostly you wont need these
    but still: from documentation:
    READ TABLE - transport_options
    Syntax
    ... [COMPARING { {comp1 comp2 ...}|{ALL FIELDS}|{NO FIELDS} }]
        [TRANSPORTING { {comp1 comp2 ...}|{ALL FIELDS} }] ... .
    Effect:
    The addition COMPARING compares the specified components comp1 comp2 ... (or the subareas or attributes thereof) in a found
    line before they are transported with the corresponding components of the work area. If ALL FIELDS is specified, all components
    are compared. If no NO FIELDS is specified, no components are compared. If the content of the compared components is
    identical, sy-subrc is set to 0. Otherwise it is set to 2. The found line is assigned to the work area independently of the result of
    the comparison.
    If the addition TRANSPORTING is specified, only the specified components comp1 comp2 ... (and their subareas) in the found line
    are assigned to the corresponding components of the work area (or their subareas). If ALL FIELDS is specified, all the
    components are assigned.
    COMPARING must be specified before TRANSPORTING. The components comp1 comp2 ... are specified according to the rules in
    the section Specifying Components. This is subject to the restriction that after TRANSPORTING, attributes of classes cannot be
    addressed using the object component selector, and after COMPARING, this is only possible as of release 6.10.

  • WHY WON'T STICKY KEYS ACCESSABILITY WORK ON SAFARI/

    WHY WON'T STICKY KEYS ACCESSABILITY FEATURE WORK ON SAFARI? I AM A DOUBLE AMPUTEE AND THIS FEATURE REALLY HELPS ME.
    RANDY

    Do us all a favor, and unlock your Cap keys.  It's considered yelling, and it's a real turn-off for those looking to help posters here.

  • Is anyone else having random file access issues? including "Element not found" error?

    I don;t know what the @#$ is going on with this device, but for example:
    user A creates a folder in their area(under a share with RW rights)
    Everything is great..
    They come in on day2, and all of a sudden, they get "Access denied" on the (excel) file
    Typically, if I re-apply full rights for them using windows permissions, it "fixes" it.
    Today, I went to modify a excel spreasheet that I've been using for a week or so, and boom, access denied
    and effective permissions indicate that very thing: no rights.
    I attempted to re-apply rights to my home directory, and on that particulat .xls, got a "Element not found" message.
    I'm sad that I've had SO much trouble with this device.
    I re-sycned with A/D just for kicks, no help.
    It syncs with A/D daily
    I've had so many of these related permissions issues, we're likel;y scrapping the Lenovo for a windows server, but I figured I'll see if anyone else is dealing with this message..
    I'm  also open to the fact that it could be our A/D I suppose..

    Sorry to reply to such an old topic, but I am having exactly the same issue.  Did you ever find a fix?  We are reapplying all the parent folder settings every morning to bandaid the situation, but it is becoming a little ridiculous...
    We have our settings so that a file administrator has full access to everyone's files, and each individual has full access to their own folder.  The folder settings never change, but the files seem to lose the user's access permission periodically after being opened or edited (haven't narrowed down the exact cause, but has never happened to files that haven't been accessed, but doesn't always happen to files that have been accessed).  One odd thing that might have something to do with it, the ownership of files keeps defaulting to a generic 63353/UNIX instead of the creator of the file or the owner of the parent folder (which is set the way we want).  We are currently experiementing with changing it, but it seems ike if we set the owner to the user, the file administrator randomly loses access, if we set to the file admin, the user randomly loses access.  I think we might be can bandaid the situation from the user's perspective with this, but it doesn't seem to fix the initial issue, that the folder permissions won't stay set.

  • Key Access NFe J1B3N - SQVI

    Dear experts
    Come here to share my necessity, I need to consult too many invoice to take its Key access.
    I thought in to build a query in SQVI, but I cannot find a table where I can take it.
    I would like to know if exist a table for it or it is built to each consult in SAP?
    Please, Could you give me a better way?
    Best Regards.
    Edson

    Hi Edson,
    Nota Fiscal tables are:
    J_1BNFDOC - Cabeçalho da nota fiscal
    J_1BNFLIN - Linha da nota fiscal
    Regards
    Renato Graneiro

  • Secret and random key

    Which algorithms use a secret key and a random key?
    Which of these are implemented (or at last con be implemented) in J2SE and J2ME?

    Which algorithms use a secret key and a random key?Secret key - symetric algorithms such as DES, AES and Twofish.
    Random key - asymetric algorithms such as RSA are normally used in conjunction with a symetric encryption algorithm using a random session Secret key.
    Which of these are implemented (or at last con be
    implemented) in J2SE and J2ME?On J2SE run
    import java.security.*;
    import java.util.Enumeration;
    public class ListAlgorithms
        public static void main(String[] args)
            // Add any provider you wish to list
            Security.addProvider(new com.sun.crypto.provider.SunJCE());
            //Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
            //Security.addProvider(new cryptix.jce.provider.CryptixCrypto());
            System.out.println("Providers -");
            Provider[] providers = java.security.Security.getProviders();
            for (int index = 0; index < providers.length; index++)
                System.out.println("    " + providers[index].getName());
                Enumeration en = providers[index].propertyNames();
                while (en.hasMoreElements())
                    String alg = (String)en.nextElement();
                     if (alg.matches("(?i)Cipher\\..*"))
                        System.out.println("        Alg = " + alg);
    }I know nothing about J2ME.

Maybe you are looking for

  • Do Not Disconnect and Being Used by Another Program

    My iPod was connected to my laptop when I started it up. It launched itunes and itunes synced and said, "It's ok to disconnect." However my iPod still flashes Do Not Disconnect. So then I tried the little eject button. That gave me the message, "Cann

  • My 2006 24" iMac (6.1) no longer recognizes Tiger 10.4

    As I remember, in 2006 this imac had Tiger 10.4 installed when new. Since then, I've done a clean install to Snow Lion 10.6.8. Now when I try to reinstall Tiger I see a dialog box that tells me this computer does not support Tiger! Does anyone know w

  • Help  related to FI module

    Hi , which are the idocs and Bapis used in Fi module. How can i search  idocs for certain modules. Thanks & regards, Chetan Sakunde

  • Please help.  Setting up a Library on external HD and reconfigure Apple TV

    Please help. I have a macbook air and recently purchased the apple tv. I am looking for help on 2 things. 1- how do I create a new iTunes library on my external HD so that the movies I have purchased from iTunes can be stored there instead of on the

  • Adhoc query selection issue

    Hi, When I use Adhoc query if "switch on object selection", found there's no selection option for IT2011(refer to screenshot), who do you know why, how to correct it?