Commonly we see php being used as an interface between the client and the database providing the information. Very few implementations utilize optimization, and thus, reduce performance. Listed below are many techniques that should be used to optimize php to sql communication.
- Do not use SELECT * unless you must
- Use SELECT priorities for better control
- SELECT var IN ([constance,...]) is very fast
- Use default values for INSERT when you can
- Do not create indexes you are not going to use
- Indexes are good for reads, but bad for writes
- When joining tables, use numbers instead of strings if you can
- Create your tables with a fixed-table format if possible
- Use OPTIMIZE TABLE and ANALYZE TABLE regularly
There are other techniques both in php design and database design that will optimize performance, but in terms of php and sql communication, this list will get you running more efficiently.







