Lodius2000 Posted January 30, 2009 Share Posted January 30, 2009 Which do you think (or do you know) is faster I am possibly taking up part of a project. It is to create a blog system for a larger website geared at having thousands of members, each with a blog among other things i am thinking of having all blog entries in one table like this, in its most basic form TABLE entries FIELDS id title entry_body username then we assemble each users blog from this query SELECT (id, title, entry_body) FROM entries WHERE username = $username or should I make a new table for each user TABLE $username_entries FIELDS id title entry_body SELECT * FROM $username_entries //SELECT statements might not always use * so take that in account of your speed estimate yes i know SELECT * statements are really fast, but i am thinking about the massive numbers of tables that mysql has to sift through before it even finds the correct one so my question is, is it faster to have thousands (if not hundreds of thousands) of entries in one table and use a WHERE clause, or is it faster to select one table from thousands and dump its contents? I just wanna know because I dont wanna necessarily clutter the database with oodles of tables unless there is a serious speed bonus thanks Quote Link to comment https://forums.phpfreaks.com/topic/143155-solved-which-is-faster/ Share on other sites More sharing options...
phparray Posted January 30, 2009 Share Posted January 30, 2009 Normalize your tables. Do not create tables with duplicate structures as in creating a table for each user. This will bloat your database for sure. Quote Link to comment https://forums.phpfreaks.com/topic/143155-solved-which-is-faster/#findComment-750836 Share on other sites More sharing options...
Mchl Posted January 30, 2009 Share Posted January 30, 2009 There's nothing wrong in having very long tables. MySQL copes very well with that. Having one table per user will drive you mad. Quote Link to comment https://forums.phpfreaks.com/topic/143155-solved-which-is-faster/#findComment-750840 Share on other sites More sharing options...
Lodius2000 Posted January 30, 2009 Author Share Posted January 30, 2009 to both of you... thanks, that reaffirms me in the direction i was leaning, I didnt want to have more tables than needed just wanted to make sure a table with thousands of records wouldnt slow me down too much... solved Quote Link to comment https://forums.phpfreaks.com/topic/143155-solved-which-is-faster/#findComment-750886 Share on other sites More sharing options...
Mchl Posted January 30, 2009 Share Posted January 30, 2009 Make sure you use good indexes, and you should be fine. Quote Link to comment https://forums.phpfreaks.com/topic/143155-solved-which-is-faster/#findComment-750905 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.