Here is an example SQL that retrieves data from EMPLOYEE and DEPARTMENT table with the employee’s grade code in the GRADE table. SELECT emp_id,...
Here the following is a simple SQL statement with a CASE expression syntax. SELECT * FROM employee WHERE CASE WHEN emp_salary<...
Some business requirements may need to compare the lower case of an indexed column to a given string as a data retrieval criterion. Here is an...
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...
You may suffer from SQL statements with a slow first execution time due to the long data cache process. The following SQL is simple that retrieves...
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...
We used to use FORCE INDEX hints to enable an index search for a SQL statement if a specific index is not used. It is due to the database SQL...
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...
something like this: Select Beverage.code, Beverage.name, store.name from Beverage, Store Where (code,store_name) in (Select code, store_name...
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...
There are some SQL statements with performance problem have to be tuned by SQL syntax rewrite and Hints injection, it is a little bit difficult...
Your end-users may keep on complaining about some functions of their database application are running slow, but you may found that those SQL...
The following is an example that shows a SQL statement with an EXISTS subquery. The SQL counts the records from the EMPLOYEE table if the OR...
Separate names with a comma.