MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question on Indexes

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Tue Sep 05, 2006 2:51 pm    Post subject: Question on Indexes Reply with quote

Hi ,
I've a table with 1 million rows with multiple indexes.One of the index
is on invc_num , confirm_dt .If I just use Invc_num in my where clause does it go through index scan or tablespace scan?

I want to use an sql like this for each invoice num in a batch program
Code:
select count(*)
where invc_num = :w-invc-num and
          eff_dt   > :w-date

eff_dt is another column which is not part of this index.

Would this affect the performance or is there an alternative to this ?

Thanks,
Vijay
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Sep 05, 2006 4:45 pm    Post subject: Reply with quote

I guess it would use the index since your invoice number is still in the query - Did you try running an EXPLAIN on this query? Your PLAN TABLE would give the ACCESSTYPE and ACCESSNAME and that should you tell you what index you are using
________
full melt hash
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group