Stephen68 Posted March 26, 2009 Share Posted March 26, 2009 Ok I'm making a little game and I'm going to use a grid map for the page to display. I am going to put each block in the grid into the database. What I'm wondering is this... How many rows are to many in a DB table? this table will have 1600 rows (800x800 grid). Before I go and start putting in the information I thought I would see if this is a normal amount for a table or not. Thanks for your time... Stephen Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/ Share on other sites More sharing options...
Mchl Posted March 26, 2009 Share Posted March 26, 2009 800x800 is 160000 If it's much, depends on your server, but for well designed database, running on modest hardware it shouldn't be any issue. Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794393 Share on other sites More sharing options...
Stephen68 Posted March 26, 2009 Author Share Posted March 26, 2009 ya forgot a few zeros there hehe.. Ok I'll fill'er up and see how it goes. Thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794405 Share on other sites More sharing options...
Mchl Posted March 26, 2009 Share Posted March 26, 2009 And I forgot how to multiply 800x800 is 640000 actually Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794409 Share on other sites More sharing options...
Stephen68 Posted March 26, 2009 Author Share Posted March 26, 2009 so will it still be ok? each player in the game will be making calls each time he moves the map? Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794420 Share on other sites More sharing options...
Mchl Posted March 26, 2009 Share Posted March 26, 2009 As long as you have proper indexing in place you should be fine. Mind that a table with 640000 rows will take several megabytes (depending on how many and what columns will it contain) Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794478 Share on other sites More sharing options...
Stephen68 Posted March 26, 2009 Author Share Posted March 26, 2009 Well, a lot of the map area will have a generic graphic to show it and it will be the same one for each spot. So I could put all the location into one row in a field delimited by a comma maybe (10|100,10|101,10|102,..ect). Then I could only have new rows that have a different graphic or player owned? Would this be a good design? Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794571 Share on other sites More sharing options...
Mchl Posted March 26, 2009 Share Posted March 26, 2009 Better approach would be to store in database only those locations, that are somehow different from 'generic' location. Then if you need to display information about given field, you check if it exists in database. If not, then display generic information. Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794581 Share on other sites More sharing options...
Stephen68 Posted March 26, 2009 Author Share Posted March 26, 2009 That's sounds like a great idea, wish I had of thought of it Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/151227-solved-number-or-rows/#findComment-794665 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.