in reply to Re^3: how to define key for a hash
in thread how to define key for a hash

my actual pb is i need a expert advice in selecting the option whether go ahead with hash from a file or hash from database. Increasing the hardware or rearranging the index can be done to get a faster serach pattern. I have to do the lookup in database only , but i thought accessing databse for such inflow of records will impact performance.SO i though of option of hash from file/database. i my case 2600*100 records/min needs to be lookup and table will have 100k records i am very bad in network area.

Replies are listed 'Best First'.
Re^5: how to define key for a hash
by Corion (Patriarch) on Jun 25, 2009 at 12:45 UTC

    Even an expert cannot tell you that without knowing your system, your environment and so on. I already told you this. If you can't do the analysis yourself, you will have to hire somebody who does the analysis for you.

      :( thaxs
        Let me try and rephrase what has been said in a way that will hopefully be of more help to you.

        The type of information you are attempting is best implemented with a database. Databases are designed exactly for the problem you are attempting to solve and using one will make your lookups much easier. A properly installed, configured, and implemented database on an adequate system will have no problem meeting your performance needs. Whether your database would be properly installed, configured, and implemented on an adequate system is not a question this forum can answer.

        If you feel that you cannot use the database solution, it is possible to solve the problem with a hash. A hash can also easily handle the problem set (100k records), assuming the system has adequate resources. You would need to key the hash by whatever unique value you have (group id?), possibly using a HoH (hash of hashes). Because your lookup values (phone numbers) are not unique, you will have to deal with the complexities of duplicate matches, etc, in your code (instead of letting a database do this for you).

        Once you have chosen one of these options, this forum can help you to progress. It cannot help you to choose which of them is appropriate, since your unique environment is not known (and that's really beyond the scope of perl help anyway).