Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Data access is too slow with the Map table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-04-03, 07:58
rajeshnaidu rajeshnaidu is offline
Registered User
 
Join Date: Oct 2003
Location: Hyderabad, India
Posts: 1
Wink Data access is too slow with the Map table

I have two Entities named STUDENT and TEACHER and a many-to-many relationship between them. So to maintain this relationship I have a map table STUDENT_TEACHER_MAP.

STUDENT(STUDENT_PK, STUDENT_NAME) --- 30,000 records
TEACHER(TEACHER_PK, TEACHER_NAME) --- 25 records
STUDENT_TEACHER_MAP(STUDENT_PK,TEACHER_PK) --- 30,000 records

Now I have a query to display the records of STUDENT_TEACHER_MAP table but results should show STUDENT_NAME and TEACHER_NAME.

Query is:

select STUDENT_NAME, TEACHER_NAME from STUDENT s, TEACHER t, STUDENT_TEACHER_MAP st_map where s.STUDENT_PK = st_map.STUDENT_PK and t.TEACHER_PK = st_map.TEACHER_PK

Here the problem is the query execution time is more. How can I reduce this time.

Even if the query is:

select STUDENT_NAME, TEACHER_NAME from STUDENT s, TEACHER t, STUDENT_TEACHER_MAP st_map where s.STUDENT_PK = st_map.STUDENT_PK and t.TEACHER_PK = st_map.TEACHER_PK and STUDENT_NAME = 'JOHN'

Here is the same problem, i.e more execution time of this query.
__________________
Rajesh Naidu P
Software Engineer
Effigent Inc
Hyderabad
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On