• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 79395
377
  • 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.
 
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic