Q
Problem solve Get help with specific problems with your technologies, process and projects.

How can SQL statements help a query's performance?

I created indexes on our database tables to increase performance of a query retrieval. How can I increase performance of the inserted SQL statements?
Adding indexes may or may not help your query performance. Simply adding them is not enough; you need to test your SQL statements to ensure that the index is helping your query performance. In some cases, an index may actually hamper performance.

One of the problems with indexes is that too many of them can hamper DML (insert, update, delete) performance....

DML operations may require the index to be updated as a result. Too many indexes can cause too much work. So it is wise to not overindex your tables. If you are having problems with INSERT performance, drop any unused indexes.

There is not much you can do for INSERT performance if your INSERT statement is like the following:

INSERT INTO my_table VALUES (1,2,3,4);
I have seen some DBAs add more freelists to their table to help INSERT performance, but it is rare that more freelists are required. If there are multiple INSERT statements in your application, then bind variables can definitely help.

Let's suppose your INSERT statement has a subquery, similar to the following:

INSERT INTO my_table SELECT colX, colY, colZ FROM your_table;
In this case, you can help your INSERT performance by tuning the subquery. Tune the SELECT statement and your INSERT performance will improve.
This was last published in May 2005

Dig Deeper on Oracle database performance problems and tuning

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close