Reply
Large Table Vs Multiple Tables
Old 02-19-2007, 09:22 AM [Resolved] Large Table Vs Multiple Tables
Junior Talker

Posts: 2
I've very new to mysql but have used it with php to create an online browser based space game. I'm about to expand by game but don't know the best way to use the database. Currently there are 10,000 records in a table called db_sectors (1.3MB) which represents all of the sectors of space in the game. This table is access heavily by the game as each nearly each page the player views shows a 5x5 grid of the galaxy so 25 records have to be accessed. I want to make the game bigger by going from 1 galaxy of 10,000 sectors to 25 galaxies of 10,000 sectors making a total of 250,000 sectors.

Should I have all the sectors in one table with a galaxy_id field to represent which galaxy the sector is from like:

db_sectors

db_sectors.sectors_id
db_sectors.sectors_galaxy_id
db_sectors.sectors_x
db_sectors.sectors_y

or have 25 tables like:

db_sectors1

db_sectors1.sectors_id
db_sectors1.sectors_x
db_sectors1.sectors_y

db_sectors2

db_sectors2.sectors_id
db_sectors2.sectors_x
db_sectors2.sectors_y

I'm worried that having 250,000 records in one table will slow the game down as the database will not be able to access the records as fast as it would with 25 seperate tables. I know very little about how mysql works and have gotten by so far with basic tutorials and lots of trial and error. Any help would be appreciated.

Last edited by dcace : 02-19-2007 at 03:01 PM.
dcace is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 02-19-2007, 02:31 PM Re: Large Table Vs Multiple Tables
Learning Newbie's Avatar
Moderator

Latest Blog Post:
Republicans Are In Trouble
Posts: 5,531
Name: John Alexander
What do your queries and indexes look like? Are you grabbing the 25 records you need at the same time, or slow-by-slow?
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 03:00 PM Re: Large Table Vs Multiple Tables
Junior Talker

Posts: 2
I've found the answer. Thanks anyway
dcace is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 04:19 PM Re: Large Table Vs Multiple Tables
Learning Newbie's Avatar
Moderator

Latest Blog Post:
Republicans Are In Trouble
Posts: 5,531
Name: John Alexander
There really isn't a single answer.
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Large Table Vs Multiple Tables
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12109 seconds with 12 queries