View previous topic :: View next topic |
Author |
Message |
selva21 Beginner
Joined: 30 Dec 2003 Posts: 53 Topics: 31
|
Posted: Mon Feb 07, 2005 7:33 am Post subject: Question on Indexspace scan/Tablespace scan |
|
|
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 |
|
|
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Mon Feb 07, 2005 8:49 am Post subject: |
|
|
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 |
|
|
selva21 Beginner
Joined: 30 Dec 2003 Posts: 53 Topics: 31
|
Posted: Mon Feb 07, 2005 9:32 am Post subject: |
|
|
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 |
|
|
|
|