Reputation: -1 Dishonored
- Active Posts:
- 46 (0.03 per day)
- 04-February 10
- Profile Views:
- Last Active:
- Oct 16 2013 11:04 PM
- Dream Kudos:
Posts I've Made
Posted 29 Mar 2013Thanks pbl for the suggestion. Can you provide me some example how to do that? Appreciated your help. Thanks.
Posted 19 Mar 2013Thanks a lot for the help. I got that working with your help.
Posted 12 Feb 2013Thanks Sheph, I was able to make that thing work with your suggestions. Appreciated your help.
Posted 1 Jul 2012
QuoteI cannot normalize any of these tables as these tables has to be in this format only
Refactoring in this case would make everyone's lives easier. A join is really only to be used in a normalized relation.
QuoteAs I am working on the project in which my team mates has asked us to use these two tables only and it was there since long time, so I cannot do anything in that table. SO that means I need to device some other efficient approach.
Seeing when something isn't working and refactoring it is an important skill in programming. You and your teammates are approaching this problem the wrong way. A database table is a giant collection. Using collections within the collection is not a good idea. Linking tables and joins are the appropriate relational way to attack the problem. Anything else will create brittle, unmaintainable, and in-extensible solutions.
ummm, As I said, I don't think so I can ask my team mates to normalize the tables as this table format is there since long time. And as you said JOINS are the only option on millions of data?
Posted 1 Jul 2012Start by normalizing your Table1. Using Collections isn't a good idea, as it makes it hard to query the database. For Table1, I would use the structure:
uid (PK) | product_id (FK) | timestamp (FK)
And it sounds like you are trying to query, using a join.
Since this is a database question, not a Java question, I'll move it to Databases.
Thanks for your comment. I cannot normalize any of these tables as these tables has to be in this format only and also I have removed lot of other fields from the tables just to make question more clear, it has more than 15 columns in both of the tables. As I am working on the project in which my team mates has asked us to use these two tables only and it was there since long time, so I cannot do anything in that table. SO that means I need to device some other efficient approach. If you are saying JOINS, then joins are not too costly?
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
raihan26 hasn't added any friends yet.