• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Least efficient way to load the data to memory

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Team,

Below is my sample data:




Question 1: What would be the least efficient way to load the above data to memory?
Question 2: Assume if i have 1000 rows of the above table structure, how do we estimate the approx. memory size of the data structure?


 
Marshal
Posts: 80665
478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really mean least efficient?
That looks like really horrible design, unless you are inserting those data into a database. Create a class which encapsulates those 5 data. You can work out the sizes of the two primitives easily enough. Strings vary depending on their size. Add a few dozen bytes to create the objects and multiply by 1000.
Which is a waste of time, because even the smallest modern computer will have enough RAM to fit 1000000 objects like that it.

By the way: there is a way to make such tables show up nicely: code tags.
 
reply
    Bookmark Topic Watch Topic
  • New Topic