Solved

Using Database Indices Effectively in JAVA

Posted on 2008-06-12
3
156 Views
Last Modified: 2010-03-30
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
        in INSURED_INFO_AREA
*********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
0
Comment
Question by:CIPL-Senthil
  • 2
3 Comments
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
Comment Utility
     Hi!

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.

Regards,
  Tomas Helgi
0
 

Author Comment

by:CIPL-Senthil
Comment Utility
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?
0
 
LVL 24

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
Comment Utility
     Hi!

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.

Regards.
   Tomas Helgi
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now