There are quite some perspectives need to keep in mind when writing SQL Queries:
1. Avoid including data type conversion in joining conditions
2. Avoid using function in joining conditions
3. Avoid using negtive joining conditions
4. Keep the joining conditions in the same data type (very critical)
5. Numerical data type faster than characters matching in joining conditions
6. Create index to improve the query performance
7. Drop index when insert if possible
8. Using Global Temporary table is faster than using CTE and Subqueries
9. Calculating should not happened in joining conditions, instead, using derived columns including the calculation
阅读(333) | 评论(0) | 转发(0) |