Hello, Since i got more than 120.000 entries in my database (over 20MB) everything i put in database, or if i want to read something, i takes long long... Anyone got any tips to make it faster load? Thanks
thanks for your answer... I think so, only i don't understand whats the different of " WHERE name = '$name' " AND " WHERE name LIKE '%string%' " If i use "LIKE" will that change something?
use there are tools u can use to measure the time it takes to execute your commands. google them, use them to play around and see what gives u the best result. LIKE '%something%' is the "%" is a wildcard like u would do *something* in a windows search u know what i mean or not ?
Without knowing anything about structure and queries, it's hard to tell. My MySQL database has over 130MB, over 1M of records and still it's pretty fast. Surely, it's on a dedicated server, but anyway...
in performance compare " WHERE name = '$name' " AND " WHERE name LIKE '%string%' " always use = is it's possible. Wildcard need more sources. Without background knowledge of you DB, MySQL has tool that shows you statistics of queries, slow queries, wrongly optimized etc. There is no general rules, that you can use. Every professional optimization is based on "it depends" ... what you want ... Basic RULE analyze and then Optimize Some basic hints: 1. Use cluster index on correct fields, use index on other fields (be careful and not over-optimize). Usually you need index on fields you are using in often queries in WHERE conditions and JOINs ... remember, index can increase read speed, but slower inserts and updates. 2. Do you have enough hardware or allocated resources? Do you have enough RAM, disk size, disk speed, how its with CPU work load ... etc. 3. Are application correctly written? Lot of PHP code using programmer style not database style. Call lot of SQL queries in loops are wrong, rewrite code to do rather all changes in one query. 4. Are you writing SQL proper way? Not using SELECT * FROM always specify only columns you need. In WHERE condition use first condition that most data amount, then second larger reduction etc. 5. Do not use IN, use Exists, its much faster etc.... there are many techniques. If you are not familiar with SQL and Databases to much, order some analysts or DB expert, it can helps you a lot.