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 Indexspace scan/Tablespace scan

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


Joined: 30 Dec 2003
Posts: 53
Topics: 31

PostPosted: Mon Feb 07, 2005 7:33 am    Post subject: Question on Indexspace scan/Tablespace scan Reply with quote

Hi,

SELECT FROM TABLE1
WHERE
FIELD_1:=VAR-1 AND/OR
FIELD_2:=VAR-2 AND/OR
FIELD_3:=VAR-3

There are indexes available on columns FIELD_1 and FIELD_2. No index on FIELD_3.

In this scenario, DB2 will go for a Indexspace scan or Tablespace scan?

Thanks,
Selva.
_________________
--------------------------------------------------------
Knowledge is power. But Imagination is more important than Knowledge. -Albert Einstein
--------------------------------------------------------
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Mon Feb 07, 2005 8:49 am    Post subject: Reply with quote

Hi selva21,

this depends on your query, are you using AND or OR, could depend on cadinality of table.

Is the index on FILED_1 only or FIELD_2 only , or both ? How many different values are available for FIELD_1and FIELD_2 ?

Use EXPLAIN command to find out, what DB2 will do !

regards,
bauer
Back to top
View user's profile Send private message
selva21
Beginner


Joined: 30 Dec 2003
Posts: 53
Topics: 31

PostPosted: Mon Feb 07, 2005 9:32 am    Post subject: Reply with quote

Thanks Bauer !

We are in the process of deciding a strategy for Adabas to DB2 migration.

Is there any document/manual available that speaks on how DB2 decides to go for Tablescan/Indexscan?

Thanks,
Selva.
_________________
--------------------------------------------------------
Knowledge is power. But Imagination is more important than Knowledge. -Albert Einstein
--------------------------------------------------------
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