Jump to content

Archived

This topic is now archived and is closed to further replies.

nitromaster

When will I need to start optimizing my db and stuff?

Recommended Posts

Hi all

I have a facebook application. Basically the database part of it stores whatever photos user's have added to the app.

I'm a total newb when it comes to php/mysql, can only do simple stuff. However the app has currently grown to just over 20k users, with phpmyadmin informing me there's 57,279 records added. I have no idea when this is going to be too big for me to handle (i am totally new to all this)

 

Basically it's one table called "userphotos"

5 fields:

id - bigint(20)

profile_id - bigint(20)

aid - bigint(20)

owner - bigint(20)

profile_type - varchar(20) latin1_swedish_ci

None of the above null.

 

I currently have my indexes like so

Indexes: 

Keyname Type Cardinality Action Field

profile INDEX 19094 profile_id

 

I think this is right, because most of my queries are like (selecting from where that field = something)

SELECT * FROM photos where profile_id='" . $profile_id . "'

 

Should i worry about the increasing size of the database yet? or?

(currently growing at 2-5k records a day i think)

 

I've heard of slowdown/etc with large databases, but have no idea how long it's gonna be before i get to that stage. (I have no idea about any of this  :confused: )

Thanks

 

 

Share this post


Link to post
Share on other sites

you should optimize regardless of how many users you have. use indexes on the information you are most likely to query and is also not a primary key. dont use select * unless you need every single field in that table. query the exact fields you need. other than that, without looking at your relations i cant say much more. if you have admin access, you could also play around with your mysql settings. show variables; will give you around 264 settings to play with.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.