Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reduce querying ODB

 
varkala prabhakar
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I have a oracle 8i database consisting of 10000 records in a table,
Now i have to check nearly more than the number of records wether the specified record is there in database or not.so what i do is every time i make the query and check in the database. Is there any method to reduce my program execution.
Even if i store table in temp array and check for the necessary condition, full array[1000][] have to be searched and i think the time taken to query the database and accessing the whole array will not make much difference.
hope for better suggestion from u all.
thanx
prabhakar.
 
Vladimir Ergovic
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add indexes to the DB if you haven't done it yet, or you could use HashMap for accessing by the key if you have some some unique keys. If thet is still to slow - try making some "smart" object which is going to contain only 1000 most wanted or recently used records. And if the record is not in the memory then query database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic