• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Using Database Indices Effectively in JAVA

Hi Experts,

My application is built in Java and the back-end is Oracle Rally installed in a Thin Server. To maximize the performance, the Database is being indexed now.

I got little information from the DBA. He says it uses Sorted indices for range retrieval and hashed for direct look-up. He has also provided me the following information about the indices.

INSURED_INFO_0400_SORTED        with column WIP_NUMBER
                                and column LAST_NAME
                                and column MIDDLE_NAME
                                and column FIRST_NAME
                                and column SSN
                                and column BIRTH_DATE

INSURED_INFO_HASH               with column WIP_NUMBER
*********This index is a placement index clustered with the data*************

INSURED_INFO_HASH_SSN           with column SSN
                                and column WIP_NUMBER
                                and column INSURED_SEQUENCE_CODE

INSURED_INFO_SORTED_001         with column LAST_NAME
                                and column FIRST_NAME
                                and column WIP_NUMBER

I would like to know, how effectively and efficiently we could make use of the indices in the Java application.

Please advice.

Thanks & Regards,
Madhu Manikandan, R
  • 2
1 Solution
Tomas Helgi JohannssonCommented:

If you want Oracle to use the indexes you create a sql query
where the columns of the indexes are used as the matching columns
in where clause of the sql query.

If Oracle ( or any other database) cannot match the sql where clause columns
to a index column it will use table scan instead of index scan.

  Tomas Helgi
CIPL-SenthilAuthor Commented:
Our backend is ORACLE RALLY [OLD VERSION]. I would like to know whether the indices created in oracle rally could be used effectively in JAVA. If so, could you please provide an example?
Tomas Helgi JohannssonCommented:

It should not matter what version of Oracle or what database it is as long as the indexes match
the where clause columns as I said before.

   Tomas Helgi
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now