-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Performance of Tables with key value pair in Hibernate
PostPosted: Thu Feb 16, 2006 1:13 am 
Newbie

Joined: Wed Nov 23, 2005 6:36 am
Posts: 3
Dear all,

I have a requirement to design table which should support multiple fields. The number of fields are not fixed as in the normal case. The user is given an option to choose the data that he needs which keep varying based on templates.

I have identified various solutions and would like to know how will the performance be while using hibernate as the ORM. Looking for suggestions on the choice of the solution.

solution 1)
Table designed with fixed columns (maximum possible columns ) say textfield1,2 ..10, datefield1,2,..10 etc. Here not always all the columns will hold data. Based on the users choice only subset of these columns will hold data. But a single object will hold the complete record


solution 2)

Table designed with Key ,value pair. Ie. Seperate tables to hold date type data, varchar, numeric etc. Each table will hold the ID,fieldname,value. In this approach Numerous number of fields can be allowed since as many rows can be inserted into the tables. And also the data type is maintained without the drawback of storing all data as varchar and then converting as separate tables being used.

But in this approach I would need to access multiple tables, multiple rows to get my complete record. But my concern is about the performance. I also need to allow search facilities.

Looking for suggestions,

Patel.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.