I have used explain Plan to check the SQL query performance, query output it showing full table scan so I decided to create index but in my where clause i have 4 columns from same table then how/on which columns I have to create INDEX
Asked
Active
Viewed 37 times
-1
-
This question does not include enough information for the community to provide you with any meaningful help. I suggest you amend your question to include the table definition as well as the query you are running against it. You might also want to include information such as the number of rows your table holds which could influence an answer. – Brett Oct 18 '17 at 21:15
1 Answers
1
Without knowing how the table is defined it's difficult to be precise, but in general you'd probably want to create a single index with all four fields in it. After you add an index you'll need to gather statistics on it using BEGIN DBMS_STATS.GATHER_TABLE_STATS(ownname => 'YOUR_SCHEMA', tabname => 'YOUR_TABLE'); END;
. If your table has only a few rows, though, the optimizer may still choose not to use an index. Best of luck.

Bob Jarvis - Слава Україні
- 48,992
- 9
- 77
- 110