I am new to php and databases administration. I am planning a site connected to database (maybe more than 1000 rows). is it better to keep everything in one table or make several smaller tables, will it be slow if everything will be in one table?
Tables with millions or even billions of rows can be perfectly performant with the right hardware, tuning, and indexing. A 1,000 row SQL database is likely to run fast even on a smartphone.
You should split your tables when it makes logical sense, i.e. a users
table and a posts
table. You shouldn't have a users_1
, users_2
, users_N
sort of scheme unless you're running something enormous - think Facebook/Twitter/Tumblr-scale - and you'll probably have moved onto something custom at that point anyways.
Don't over-engineer - what you're doing is deemed "premature optimization".