The Query Rewriter Plugin in MySQL is a component that allows you to modify incoming SQL queries before execution. It provides the ability to...
Leveraging Plan Guides in MS SQL Server can prove beneficial for optimizing the performance of a particular query within database objects like...
Here the following is an Update SQL with a subquery that updates the EMPLOYEE table if the emp_dept satisfies the records returned from a...
Here the following is an example SQL shows you that select the maximum emp_address which is not indexed in the EMPLOYEE table with 3 million...
For some SQL statements with multiple Max() functions in the select list and nothing in the Where clause, we have different methods to create new...
We know the order of the columns in a composite index will determine the usage of the index or not against a table. A query will use a composite...
For some SQL statements that are failed to be tuned by syntax rewrite, hints injection, and all necessary indexes are built, people may think that...
Here the following is the description of the ORDERED hint. The ORDERED hint causes Oracle to join tables in the order in which they appear in the...
There are some SQL statements with performance problem can be tuned by Hints injection only. Here is an example to show you how to use...
Some mission-critical SQL statements are already reached their maximum speed within the current indexes configuration. It means that those SQL...
We have discussed how to tune a CASE expression SQL with hardcoded literals in my last blog: How to Tune SQL Statement with CASE Expression for...
Here the following is a simple SQL statement with a CASE expression syntax. SELECT * FROM EMPLOYEE WHERE CASE when emp_id < 1001000 then 'Old...
Your end-users may keep on complaining about some functions of their database application are running slow, but you may found that those SQL...
Some SQL statements will be running very slow after SET ROWCOUNT or TOP is used. SET ROWCOUNT and TOP are used to tell SQL Server to select a...
The following is an example shows a SQL statement with an IN List expression. The SQL retrieves records from EMPLOYEE table that EMP_DEPT should...
There may be some business requirements that need to compare concatenate strings and column with a given unknown length of the bind variable....
The following is an example shows a SQL statement with two conditions “emp_dept=dpt_id and emp_dept<'L'” . select * from employee, department...
The following is an example shows a SQL statement with two potential table join paths. “Employee to Department” and “Department to Employee” are...
Here is an example SQL that retrieves data from EMPLOYEE table with “emp_id < 710000” and employee’s department code exists in DEPARTMENT table....
Semi-join is introduced in Oracle 8.0. It provides an efficient method of performing a WHERE EXISTS or WHERE IN sub-queries. A semi-join returns...
Separate names with a comma.