If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Design: over-generalisation or not ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-24-04, 11:46
Amn Amn is offline
Registered User
 
Join Date: Jul 2004
Posts: 8
Exclamation Design: over-generalisation or not ?

Hi all !

I have designed my database using a somewhat oriented approach. Rows are objects, and different type of objects are in different tables, but since my objects share a common set of fields like ExpireDate, Archived, Draft, CreateDate, CreatorID, etc; I have an 'objects' table with these columns, and I have set up a foreign key in other tables where there is a need for a row-to-row integrity.

Now my question is, since I have to SELECT using INNER JOIN with object and the corresponding table, merely to filter out archived rows, I am wondering if I would be better off actually putting the common fields into each respective table and get rid of the 'objects' table altogether. I mean, is it more job for the server to actually JOIN the tables for each SELECT versus having a clean design with object oriented approach ?

How bad is my design, and what are the recommendations of experts who obviously were tempted to create an object oriented database design ?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 11-25-04, 01:06
Sudar Sudar is offline
Registered User
 
Join Date: Jul 2004
Location: Mars
Posts: 137
Thumbs up

Using Join for each Select will surely be a over head for the server especially if the number of rows in each table is very high,

Clean table design and performance are usually like tow ends of a coin. Its not possible to have both.

So analyse your requirements. If the select query with join is going to be used very rarely then u can proceed with your current design, on the other hand if it is going to be executed many times then it is better to avoid the Join.

Again, this is just my own opinion, analyse ur requirements and then do any change in your design
__________________
Sudar

--
My Blog
Reply With Quote
  #3 (permalink)  
Old 11-28-04, 08:55
Amn Amn is offline
Registered User
 
Join Date: Jul 2004
Posts: 8
Thanks!

Well, the query is going to request the forum posts and there will be many of them to choose from, yet I see the situation of duplicaing the common fields into each table as rather stupid thing to do. Am I wrong ? Should I duplicate the fields into each table, and get rid of that INNER JOIN ?

Amn.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On