» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2006, 02:31 PM
hatim hatim is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
hatim is on a distinguished road
Default large database

Hi

I have a database with about 3.5 million unique items. There is a table that covers which categories each item belongs to. The average item belongs to 3 categories.....the categories are used for navigation on a website.

The question - is it better to split each entry for each category into a its own row (~10m rows) or to have each unique item and list all of it's categories in a delimited fashion (category2323|category23489|category382233) in a single row for each category and only have around 3.5m rows.

Please help me out.
Many thanks -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 07-26-2006, 02:41 PM
retro retro is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
retro is on a distinguished road
Default

that depends on your queries

if you ever need to search on items belonging to a specific category, then the delimited strategy requires a table scan, and trust me, you never want to do that on 3 million rows

with separate rows for each category, you can use an index, and that works in fractions of a second

does that answer your question? -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #3  
Old 07-26-2006, 02:49 PM
yoyo yoyo is offline
OSP Starters
 
Join Date: Apr 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
yoyo is on a distinguished road
Default

No offence and no pun intended, but a programmer who recommends storing multiple values in a delimited field obviously doesn't know the difference between an index-based query and a table scan. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #4  
Old 07-26-2006, 02:52 PM
hatim hatim is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
hatim is on a distinguished road
Default

The programmer had told me he had never worked with a database this large, but he's primarly a php guy. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #5  
Old 07-26-2006, 03:05 PM
hotty hotty is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
hotty is on a distinguished road
Default

Then my suggestion is to hint to him that he needs to read up on database design, normalization, and optimization. Otherwise, you could end up with something that is ineffecient. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #6  
Old 07-26-2006, 03:08 PM
pixel pixel is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
pixel is on a distinguished road
Default

one more option, he can also hire a separate person to do the database design.

Good Luck -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #7  
Old 07-26-2006, 03:17 PM
hatim hatim is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
hatim is on a distinguished road
Default

yes, u are right,

I was just trying to get the structure down, I will hire somebody else down the road to go in and try to optimize the database and queries. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #8  
Old 07-26-2006, 03:21 PM
Garros Garros is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Garros is on a distinguished road
Default

I would not recommend this, u need to get the database structure orrect the first time. it's not just as easy as "optimize the database and queries". resturcturing the database to correct fundamental flaws often results in have to rewrite major portions of the application.

Bye -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
database conversion issue? Akunh MySQL Forums 1 01-17-2007 07:41 AM
database backing up... santiago MySQL Forums 1 10-02-2006 07:27 AM
10,090 Entry Chinese Learning Database klown Sell Internet Services 0 09-07-2006 02:17 PM
DiscountASP.NET Launches SQL Database Transfer Tool outsourcingplans Web Hosting News 0 08-09-2006 04:23 AM
Database Inquiry ?? umbika ASP forums and Tips 2 12-14-2005 05:08 AM


All times are GMT. The time now is 08:55 PM.