473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Index not used only on a particular environment

Hello,
I have a table which has around 3 billion records on an env and a
simple query against it goes for a tablescan eventhough an index has
been defined and this happens only on an env.

Details are as below. Please advice
Query Considered :
select A.OPTN_CD from VIN_VEH_OPTNS as A WHERE A.DWH_UPD_TIMSTM <
(SELECT MAX(DWH_ETL_ST_TIMSTM) FROM DWH_CONTROL where DWH_SEQ_NM
='SSeq' and DWH_ETL_STATUS='S')

Indexes: (which is same on both env)
No Index on DWH_CONTROL table
Index on VIN_VEH_OPTNS
DWH_UPD_TIMSTM ASC

Env1 : where Index is used
Logically partitioned db having 4 logical partitions
VIN_VEH_OPTNS table has around 100 million records (this is a
partitioned table spread across 3 logical partition)
DWH_CONTROL table has around 1000 records (non-partitioned table
located on the 4th partition)
Access Plan:

RETURN
( 1)
|
BTQ
( 2)
|
NLJOIN
( 3)
/--------/ \-------\
GRPBY FETCH
( 4) (----)
| / \
BTQ RIDSCN Table:
( 5) ( 9) CARD
| | VIN_VEH_OPTNS
GRPBY SORT
( 6) ( 10)
| |
TBSCAN IXSCAN
( 7) ( 11)
| / \
Table: Index: Table:
CARD CARD CARD
DWH_CONTROL XIF4VIN_VEHOPTNS VIN_VEH_OPTNS

Env2: where Table scan is performed
Logically parititioned db having 8 logical parittions
VIN_VEH_OPTNS table has around 3 billion records(this is a partitioned
table spread across 7 logical partition)
DWH_CONTROL table has around 1000 records (non-partitioned table
located on the 8th partition)

Access Plan:
RETURN
( 1)
|
BTQ
( 2)
|
FETCH
(----)
/ \
RIDSCN Table:
( 4) CARD
| VIN_VEH_OPTNS
SORT
( 5)
|
IXSCAN
( 6)
/ \
Index: Table:
CARD CARD
XIF4VIN_VEHOPTNS VIN_VEH_OPTNS
Any suggestion is greatly appreciated.

Thanks, Victor

Sep 20 '06 #1
5 1700
I've posted a wrong access plan for the Env2(where tablescan is
happening). Here is the correct one

Optimizer Plan:

RETURN
( 1)
|
BTQ
( 2)
|
NLJOIN
( 3)
/ \
BTQ TBSCAN
( 4) ( 3)
| |
GRPBY Table:
( 5) CARD
| VIN_VEH_OPTNS
TBSCAN
( 6)
|
Table:
CARD
DWH_CONTROL
Victor wrote:
Hello,
I have a table which has around 3 billion records on an env and a
simple query against it goes for a tablescan eventhough an index has
been defined and this happens only on an env.

Details are as below. Please advice
Query Considered :
select A.OPTN_CD from VIN_VEH_OPTNS as A WHERE A.DWH_UPD_TIMSTM <
(SELECT MAX(DWH_ETL_ST_TIMSTM) FROM DWH_CONTROL where DWH_SEQ_NM
='SSeq' and DWH_ETL_STATUS='S')

Indexes: (which is same on both env)
No Index on DWH_CONTROL table
Index on VIN_VEH_OPTNS
DWH_UPD_TIMSTM ASC

Env1 : where Index is used
Logically partitioned db having 4 logical partitions
VIN_VEH_OPTNS table has around 100 million records (this is a
partitioned table spread across 3 logical partition)
DWH_CONTROL table has around 1000 records (non-partitioned table
located on the 4th partition)
Access Plan:

RETURN
( 1)
|
BTQ
( 2)
|
NLJOIN
( 3)
/--------/ \-------\
GRPBY FETCH
( 4) (----)
| / \
BTQ RIDSCN Table:
( 5) ( 9) CARD
| | VIN_VEH_OPTNS
GRPBY SORT
( 6) ( 10)
| |
TBSCAN IXSCAN
( 7) ( 11)
| / \
Table: Index: Table:
CARD CARD CARD
DWH_CONTROL XIF4VIN_VEHOPTNS VIN_VEH_OPTNS

Env2: where Table scan is performed
Logically parititioned db having 8 logical parittions
VIN_VEH_OPTNS table has around 3 billion records(this is a partitioned
table spread across 7 logical partition)
DWH_CONTROL table has around 1000 records (non-partitioned table
located on the 8th partition)

Access Plan:
RETURN
( 1)
|
BTQ
( 2)
|
FETCH
(----)
/ \
RIDSCN Table:
( 4) CARD
| VIN_VEH_OPTNS
SORT
( 5)
|
IXSCAN
( 6)
/ \
Index: Table:
CARD CARD
XIF4VIN_VEHOPTNS VIN_VEH_OPTNS
Any suggestion is greatly appreciated.

Thanks, Victor
Sep 20 '06 #2
Why isn't the small table replicated?
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 20 '06 #3
Thanks for a quick reply. I recently interited this database and it has
been designed as such so I may consider that option as well in future.
However when I see the access plan I dont see any big data movement
across data partiton and it shows only a tablescan hence I thought that
something else is going wrong.


Serge Rielau wrote:
Why isn't the small table replicated?
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 20 '06 #4
Victor wrote:
Thanks for a quick reply. I recently interited this database and it has
been designed as such so I may consider that option as well in future.
However when I see the access plan I dont see any big data movement
across data partiton and it shows only a tablescan hence I thought that
something else is going wrong.
The benefit of a replicated table is that it can be indexed on each node.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 20 '06 #5
ok, Thanks. I would implement a replicated MQT and recheck.

Serge Rielau wrote:
Victor wrote:
Thanks for a quick reply. I recently interited this database and it has
been designed as such so I may consider that option as well in future.
However when I see the access plan I dont see any big data movement
across data partiton and it shows only a tablescan hence I thought that
something else is going wrong.
The benefit of a replicated table is that it can be indexed on each node.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
29
by: shmartonak | last post by:
For maximum portability what should the type of an array index be? Can any integer type be used safely? Or should I only use an unsigned type? Or what? If I'm using pointers to access array...
6
by: Ian Ribas | last post by:
Hello, This is probably a common problem, but I couldn't really find a direct answer in the archives (or maybe just couldn't find one that satisfied me ;-). I created an index specifically to...
2
by: Martin v. Löwis | last post by:
I've been working on PEP 353 for some time now. Please comment, in particular if you are using 64-bit systems. Regards, Martin PEP: 353 Title: Using ssize_t as the index type Version:...
4
by: Massimo | last post by:
I have a very very strange situation with a particular application and sql server 2005 enterprise. This application combines numerical data from multiple tables. User can make query over this...
122
by: C.L. | last post by:
I was looking for a function or method that would return the index to the first matching element in a list. Coming from a C++ STL background, I thought it might be called "find". My first stop was...
0
by: muzu1232004 | last post by:
If I have a table t1 with a column a as follows A 1 1 1 1 1 1 1
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.