This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Indexing versus New tables Creation  RSS feed

Tirumal Reddy
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kindly help me in getting better performance

With our application...
1) Data is received from other legacy system's and stored in database
2) At appl startup data stored in db is cached for better performance
3) Data is shown to the screens by retrieving from the caches

Requirement : However there is some data which is not required to show up to the screens. Kindly note we require this data for history purpose.

Now problem is how to get better performance out of two solutions provided below.

Solution1: Not to load the data into caches by using where condition and doing indexing on the table.
Pros: Very simple change just to add a if condition and no logic change.

Solution2: Push the data into new tables for history purpose.
Cons:These tables to be created and logic to be changed to push this data into new tables.

Let me know if the above is not clear.
Thanks in advance.
rajesh bala
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on the data size of the main table you have for saving the data from legacy systems.

Solution 1:
1. Its simple. However, if you are not going to use it for runtime, its just historical data. The performance will definitely improve by having "proper" indexes..If you add wrong index, it might even degrade the system performance. I would go with this approach, if I am "totally" sure that the amount of data in this table will not grow much.

Solution 2:
1. It sounds better design wise and maintainability wise. Its always better to push the historical data to separate table for archiving or whatever future needs. This way, your runtime data table might be small and easier for quering as well.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!