- Store relevant and necessary information in the database instead of an application structure or an array.
- Use normalized tables in the database. Small multiple tables are usually better than one large table.
- If you use any enumerated field to create look up for it in the database itself then maintain the database.
- Keep primary key of lesser chars or integers. It is easier to process small width keys.
- Store image paths or URLs in the database instead of the images. It has less overhead.
- Use proper database types for the fields. If StartDate is the database, use date time as datatypes instead of VARCHAR (20).
- Specify the column names instead of using * in SELECT statement.
- Use LIKE clause properly. If you are looking for an exact match, use “=” instead.
- Write SQL keyword in the capital letters for readability purposes.
- Using JOIN is better for performance than using sub queries or the nested queries.
- Use the stored procedures. They are faster and help in maintainability as well as security of the database.
- The user comments for readability as well as guidelines for the next developer, who comes to modify the same code. Proper documentation of an Application will also help.
- Proper indexing will improve the speed of operations in the database.
- Make sure to test any of the database programming as well administrative changes.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

SubashPosted Feb 16, 2017, 8:15 PM
Very useful tips for optimization and SQL Code standards