473,657 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Federated Join EE to EEE


I am attempting to join two tables together on two different unix
servers. Here is some relevant info about the tables.

TABLE 1 Setup

-----------------------

DB2 UDB 7.2 EE

AIX

CBS_STG.S_BAT_I N

Number of Rows About 200,000

No Indexes

CREATE TABLE CBS_STG.S_BAT_I N(

NUMBER_1_3 SMALLINT NOT NULL,

NUMBER_4_6 SMALLINT NOT NULL,

NUMBER_7_9 SMALLINT NOT NULL,

);

TABLE 2 Setup

------------------------

DB2 UDB 7.2 EEE

AIX

8 Nodes

BILL_DW.BILL_AC CT

Number of Rows about 15,000,000

Partitioning Key On BILL_ACCT_KEY

Index on BILL_ACCT_NUM

CREATE TABLE BILL_DW.BILL_AC CT(

BILL_ACCT_KEY INTeger NOT NULL,

BILL_ACCT_NUM CHARacter(9) NOT NULL

);

CREATE INDEX BILL_ACCT_X1 ON BILL_DW.BILL_AC CT(BILL_ACCT_NU M);

Utilizing federation I am now attempting to join the following tables
together utilizing the following SQL Statement.

SELECT BILL_ACCT.BILL_ ACCT_KEY, BILL_ACCT.BILL_ ACCT_NUM

FROM CBS_STG.S_BAT_I N S_BAT_IN,

BILL_DW.BILL_AC CT BILL_ACCT

WHERE BILL_ACCT.BILL_ ACCT_NUM = CAST(RIGHT(
DIGITS(S_BAT_IN .NUMBER_1_3),3) ||

RIGHT( DIGITS(S_BAT_IN .NUMBER_4_6),3) || RIGHT(

DIGITS(S_BAT_IN .NUMBER_7_9),3) as CHAR(9));

Running this through explain plan yields the following "Optimized
Statement".

SELECT Q2.$C0 AS "BILL_ACCT_KEY" , Q2.$C1 AS "BILL_ACCT_ NUM"

FROM

(SELECT Q1.BILL_ACCT_KE Y, Q1.BILL_ACCT_NU M

FROM BILL_DW.BILL_AC CT AS Q1) AS Q2, CBS_STG.S_BAT_I N AS Q3

WHERE (Q2.$C1 = CHAR(("SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_1_ 3),

4000), 3) || "SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_4_ 6),

4000), 3) || "SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_7_ 9),

4000), 3)), 9))

Notice in the optimized query the following statement (SELECT
Q1.BILL_ACCT_KE Y, Q1.BILL_ACCT_NU M FROM BILL_DW.BILL_AC CT AS Q1) AS Q2
Why is it doing this? This will produce an inline view with no
indexes which means I am then joining a 200,000 row table to a
15,000,000 table together through table scan. Why can it not
effectively push down the CBS_STG.S_BAT_I N table to create a temp table
and then join to the BILL_DW.BILL_AC CT table utilizing an index. The
query is being run from the system that contains BILL_DW.BILL_AC CT and
the reason being is we though it would only have to push down the
smallest tables contents. The cost on the query is 3.23844e+10 and as
you can guess doesn't ever finish executing. How can I better optimize
this join through federation?

Spencer
--
Posted via http://dbforums.com
Nov 12 '05 #1
7 2909
Hi Spencer, Can you post the optimizer plan too? What SQL is in the RQUERY
or SHIP operator? Do you see any ISCAN on the local
table?(BILL_DW. BILL_ACCT)
The optimized statement that you posted is not actually the remote stmt that
we are generating. Its an intermediate form though.
Thanks
Aakash
"stabbert" <me*********@db forums.com> wrote in message
news:35******** ********@dbforu ms.com...

I am attempting to join two tables together on two different unix
servers. Here is some relevant info about the tables.

TABLE 1 Setup

-----------------------

DB2 UDB 7.2 EE

AIX

CBS_STG.S_BAT_I N

Number of Rows About 200,000

No Indexes

CREATE TABLE CBS_STG.S_BAT_I N(

NUMBER_1_3 SMALLINT NOT NULL,

NUMBER_4_6 SMALLINT NOT NULL,

NUMBER_7_9 SMALLINT NOT NULL,

);

TABLE 2 Setup

------------------------

DB2 UDB 7.2 EEE

AIX

8 Nodes

BILL_DW.BILL_AC CT

Number of Rows about 15,000,000

Partitioning Key On BILL_ACCT_KEY

Index on BILL_ACCT_NUM

CREATE TABLE BILL_DW.BILL_AC CT(

BILL_ACCT_KEY INTeger NOT NULL,

BILL_ACCT_NUM CHARacter(9) NOT NULL

);

CREATE INDEX BILL_ACCT_X1 ON BILL_DW.BILL_AC CT(BILL_ACCT_NU M);

Utilizing federation I am now attempting to join the following tables
together utilizing the following SQL Statement.

SELECT BILL_ACCT.BILL_ ACCT_KEY, BILL_ACCT.BILL_ ACCT_NUM

FROM CBS_STG.S_BAT_I N S_BAT_IN,

BILL_DW.BILL_AC CT BILL_ACCT

WHERE BILL_ACCT.BILL_ ACCT_NUM = CAST(RIGHT(
DIGITS(S_BAT_IN .NUMBER_1_3),3) ||

RIGHT( DIGITS(S_BAT_IN .NUMBER_4_6),3) || RIGHT(

DIGITS(S_BAT_IN .NUMBER_7_9),3) as CHAR(9));

Running this through explain plan yields the following "Optimized
Statement".

SELECT Q2.$C0 AS "BILL_ACCT_KEY" , Q2.$C1 AS "BILL_ACCT_ NUM"

FROM

(SELECT Q1.BILL_ACCT_KE Y, Q1.BILL_ACCT_NU M

FROM BILL_DW.BILL_AC CT AS Q1) AS Q2, CBS_STG.S_BAT_I N AS Q3

WHERE (Q2.$C1 = CHAR(("SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_1_ 3),

4000), 3) || "SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_4_ 6),

4000), 3) || "SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_7_ 9),

4000), 3)), 9))

Notice in the optimized query the following statement (SELECT
Q1.BILL_ACCT_KE Y, Q1.BILL_ACCT_NU M FROM BILL_DW.BILL_AC CT AS Q1) AS Q2
Why is it doing this? This will produce an inline view with no
indexes which means I am then joining a 200,000 row table to a
15,000,000 table together through table scan. Why can it not
effectively push down the CBS_STG.S_BAT_I N table to create a temp table
and then join to the BILL_DW.BILL_AC CT table utilizing an index. The
query is being run from the system that contains BILL_DW.BILL_AC CT and
the reason being is we though it would only have to push down the
smallest tables contents. The cost on the query is 3.23844e+10 and as
you can guess doesn't ever finish executing. How can I better optimize
this join through federation?

Spencer
--
Posted via http://dbforums.com

Nov 12 '05 #2

I am attaching the entire plan. I am unfamilar on how to capture the
RQUERY and SHIP Operator?

Spencer

DB2 Universal Database Version 7.2, 5622-044 (c) Copyright IBM Corp.
1991, 2001

Licensed Material - Program Property of IBM

IBM DATABASE 2 Explain Table Format Tool



*************** ***** EXPLAIN INSTANCE *************** *****

DB2_VERSION: 07.02.8

SOURCE_NAME: SQLC2D04

SOURCE_SCHEMA: NULLID

EXPLAIN_TIME: 2003-10-30-10.53.19.562984

EXPLAIN_REQUEST ER: DB2UDB

Database Context:

----------------

Parallelism: Intra-Partition & Inter-Partition
Parallelism

CPU Speed: 1.058838e-06

Comm Speed: 100

Buffer Pool size: 250400

Sort Heap size: 7500

Database Heap size: 12000

Lock List size: 1200

Maximum Lock List: 10

Average Applications: 4

Locks Available: 13560

Package Context:

---------------

SQL Type: Dynamic

Optimization Level: 5

Blocking: Block All Cursors

Isolation Level: Cursor Stability



---------------- STATEMENT 1 SECTION 201 ----------------

QUERYNO: 1

QUERYTAG: CLP

Statement Type: Select

Updatable: No

Deletable: No

Query Degree: -1

Original Statement:

------------------

SELECT BILL_ACCT.BILL_ ACCT_KEY, BILL_ACCT.BILL_ ACCT_NUM

FROM CBS_STG.S_BAT_I N S_BAT_IN, BILL_DW.BILL_AC CT BILL_ACCT

WHERE BILL_ACCT.BILL_ ACCT_NUM = CAST(RIGHT(
DIGITS(S_BAT_IN .NUMBER_1_3),3) ||

RIGHT( DIGITS(S_BAT_IN .NUMBER_4_6),3) || RIGHT(

DIGITS(S_BAT_IN .NUMBER_7_9),3) as CHAR(9))

Optimized Statement:

-------------------

SELECT Q2.$C0 AS "BILL_ACCT_KEY" , Q2.$C1 AS "BILL_ACCT_ NUM"

FROM

(SELECT Q1.BILL_ACCT_KE Y, Q1.BILL_ACCT_NU M

FROM BILL_DW.BILL_AC CT AS Q1) AS Q2, CBS_STG.S_BAT_I N AS Q3

WHERE (Q2.$C1 = CHAR(("SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_1_ 3),

4000), 3) || "SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_4_ 6),

4000), 3) || "SYSFUN
"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_7_ 9),

4000), 3)), 9))

Access Plan:

-----------

Total Cost: 3.23844e+10

Query Degree: 0

Rows

RETURN

( 1)

Cost

I/O

|

2.21859e+06

NLJOIN

( 2)

3.23844e+10

20372

/---+---\

1.43694e+07 0.154397

DTQ TBSCAN

( 3) ( 5)

83601.9 11966.4

18913 354

| |

1.79617e+06 277324

TBSCAN TEMP

( 4) ( 6)

77388.4 9712.65

18913 354

| |

1.79617e+06 277324

TABLE: BILL_DW RQUERY

BILL_ACCT ( 7)

9360.27

354

|

277324

NK: CBS_STG

S_BAT_IN
--
Posted via http://dbforums.com
Nov 12 '05 #3

1) RETURN: (Return Result)

Cumulative Total Cost: 3.23844e+10

Cumulative CPU Cost: 3.05847e+16

Cumulative I/O Cost: 20372

Cumulative Re-Total Cost: 3.23843e+10

Cumulative Re-CPU Cost: 3.05847e+16

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 24334.7

Cumulative Comm Cost: 227622

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 20018

Remote communication cost: 143984

Arguments:

---------

BLDLEVEL: (Build level)

DB2 v7.1.0.82 : s030617

ENVVAR : (Environment Variable)

DB2_HASH_JOIN = ON

Input Streams:

-------------

8) From Operator #2

Estimated number of rows:
2.21859e+06

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 2

Subquery predicate ID: Not
Applicable

Column Names:

------------

+BILL_ACCT_NUM+ BILL_ACCT_KEY

Partition Column Names:

----------------------

+NONE

2) NLJOIN: (Nested Loop Join)

Cumulative Total Cost: 3.23844e+10

Cumulative CPU Cost: 3.05847e+16

Cumulative I/O Cost: 20372

Cumulative Re-Total Cost: 3.23843e+10

Cumulative Re-CPU Cost: 3.05847e+16

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 24334.7

Cumulative Comm Cost: 227622

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 20018

Remote communication cost: 143984

Arguments:

---------

EARLYOUT: (Early Out flag)

FALSE

FETCHMAX: (Override for FETCH MAXPAGES)

IGNORE

ISCANMAX: (Override for ISCAN MAXPAGES)

IGNORE

Predicates:

----------

2) Predicate used in Join

Relational Operator: Equal (=)

Subquery Input Required: No

Filter Factor: 5.5674e-07

Predicate Text:

--------------

(Q2.$C1 = CHAR(("SYSFUN

"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_1_ 3), 4000),

"." 3) || "SYSFUN

"."

"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_4_ 6), 4000),

"." 3) || "SYSFUN

"."

"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_7_ 9), 4000),

"." 3)), 9))

Input Streams:

-------------

3) From Operator #3

Estimated number of rows:
1.43694e+07

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 2

Subquery predicate ID: Not
Applicable

Column Names:

------------

+BILL_ACCT_KEY+ BILL_ACCT_NUM

Partition Column Names:

----------------------

+NONE

7) From Operator #5

Estimated number of rows: 0.154397

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

8) To Operator #1

Estimated number of rows:
2.21859e+06

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 2

Subquery predicate ID: Not
Applicable

Column Names:

------------

+BILL_ACCT_NUM+ BILL_ACCT_KEY

Partition Column Names:

----------------------

+NONE

3) TQ : (Table Queue)

Cumulative Total Cost: 83601.9

Cumulative CPU Cost: 9.05114e+09

Cumulative I/O Cost: 18913

Cumulative Re-Total Cost: 3275

Cumulative Re-CPU Cost: 3.09301e+09

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 25.1882

Cumulative Comm Cost: 227622

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 18913

Arguments:

---------

JN INPUT: (Join input leg)

OUTER

LISTENER: (Listener Table Queue type)

FALSE

TQMERGE : (Merging Table Queue flag)

FALSE

TQREAD : (Table Queue Read type)

READ AHEAD

TQSEND : (Table Queue Write type)

DIRECTED

UNIQUE : (Uniqueness required flag)

FALSE

Input Streams:

-------------

2) From Operator #4

Estimated number of rows:
1.79617e+06

Partition Map ID: -100

Partitioning: (MULT )

Multiple
Partiti-
ons

Number of columns: 2

Subquery predicate ID: Not
Applicable

Column Names:

------------

+BILL_ACCT_KEY+ BILL_ACCT_NUM

Partition Column Names:

----------------------

+1: BILL_ACCT_KEY

Output Streams:

--------------

3) To Operator #2

Estimated number of rows:
1.43694e+07

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 2

Subquery predicate ID: Not
Applicable

Column Names:

------------

+BILL_ACCT_KEY+ BILL_ACCT_NUM

Partition Column Names:

----------------------

+NONE

4) TBSCAN: (Table Scan)

Cumulative Total Cost: 77388.4

Cumulative CPU Cost: 3.18289e+09

Cumulative I/O Cost: 18913

Cumulative Re-Total Cost: 3275

Cumulative Re-CPU Cost: 3.09301e+09

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 25.0522

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 18913

Arguments:

---------

MAXPAGES: (Maximum pages for prefetch)

ALL

PREFETCH: (Type of Prefetch)

SEQUENTIAL

ROWLOCK : (Row Lock intent)

NEXT KEY SHARE

SCANDIR : (Scan Direction)

FORWARD

TABLOCK : (Table Lock intent)

INTENT SHARE

Input Streams:

-------------

1) From Object BILL_DW.BILL_AC CT

Estimated number of rows:
1.79617e+06

Partition Map ID: 6

Partitioning: (MULT )

Multiple
Partiti-
ons

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+$RID$+BILL_ACC T_NUM+BILL_ACCT _KEY

Partition Column Names:

----------------------

+1: BILL_ACCT_KEY

Output Streams:

--------------

2) To Operator #3

Estimated number of rows:
1.79617e+06

Partition Map ID: -100

Partitioning: (MULT )

Multiple
Partiti-
ons

Number of columns: 2

Subquery predicate ID: Not
Applicable

Column Names:

------------

+BILL_ACCT_KEY+ BILL_ACCT_NUM

Partition Column Names:

----------------------

+1: BILL_ACCT_KEY

5) TBSCAN: (Table Scan)

Cumulative Total Cost: 11966.4

Cumulative CPU Cost: 2.94321e+09

Cumulative I/O Cost: 354

Cumulative Re-Total Cost: 2253.7

Cumulative Re-CPU Cost: 2.12846e+09

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 11966.4

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 1105

Remote communication cost: 143984

Arguments:

---------

JN INPUT: (Join input leg)

INNER

MAXPAGES: (Maximum pages for prefetch)

ALL

PREFETCH: (Type of Prefetch)

NONE

SCANDIR : (Scan Direction)

FORWARD

Predicates:

----------

2) Sargable Predicate

Relational Operator: Equal (=)

Subquery Input Required: No

Filter Factor: 5.5674e-07

Predicate Text:

--------------

(Q2.$C1 = CHAR(("SYSFUN

"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_1_ 3), 4000),

"." 3) || "SYSFUN

"."

"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_4_ 6), 4000),

"." 3) || "SYSFUN

"."

"."RIGHT"($INTE RNAL_FUNC$(DIGI TS(Q3.NUMBER_7_ 9), 4000),

"." 3)), 9))

Input Streams:

-------------

6) From Operator #6

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

7) To Operator #2

Estimated number of rows: 0.154397

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

6) TEMP : (Create Temporary Table)

Cumulative Total Cost: 9712.65

Cumulative CPU Cost: 8.14717e+08

Cumulative I/O Cost: 354

Cumulative Re-Total Cost: 0

Cumulative Re-CPU Cost: 0

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 9712.65

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 1105

Remote communication cost: 143984

Arguments:

---------

CSETEMP : (Temp over common sub-expression flag)

FALSE

SLOWMAT : (Slow Materialization flag)

FALSE

TEMPSIZE: (Temporary Table Page Size)

4096

Input Streams:

-------------

5) From Operator #7

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

6) To Operator #5

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE
--
Posted via http://dbforums.com
Nov 12 '05 #4

7) RQUERY: (Remote Query)

Cumulative Total Cost: 9360.27

Cumulative CPU Cost: 4.81917e+08

Cumulative I/O Cost: 354

Cumulative Re-Total Cost: 505.361

Cumulative Re-CPU Cost: 4.77279e+08

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 25.0561

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 355

Remote communication cost: 143984

Arguments:

---------

CSERQY : (Remote common subexpression)

FALSE

RMTQTXT : (Remote statement)

SELECT A0."NUMBER_1_3" , A0."NUMBER_4_6" ,
A0."NUMBER_7_9 " FROM "CBS_STG"."S_BA T_IN" A0

RMTSEVER: (Remote server)

STG_P01

STREAM : (Remote stream)

FALSE

Input Streams:

-------------

4) From Object CBS_STG.S_BAT_I N

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 53

Subquery predicate ID: Not
Applicable

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

5) To Operator #6

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Objects Used in Access Plan:

---------------------------

Schema: CBS_STG

Name: S_BAT_IN

Type: Nickname

Time of creation: 2003-10-27-
13.05.47.308142

Last statistics update:

Number of columns: 53

Number of rows: 277324

Width of rows: 18

Number of buffer pool pages: 4334

Distinct row values: No

Tablespace name:

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 32

Container extent page count: 32

Schema: BILL_DW

Name: BILL_ACCT

Type: Table

Time of creation: 2003-06-27-
08.37.51.360009

Last statistics update: 2003-10-27-
12.48.38.364203

Number of columns: 7

Number of rows: 1796172

Width of rows: 25

Number of buffer pool pages: 18913

Distinct row values: No

Tablespace name:
BILL_DW_BILL_AC CT

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 64

Container extent page count: 32

Table overflow record count: 0
--
Posted via http://dbforums.com
Nov 12 '05 #5
I see that a nested loop join is executed. I would make sure to run RUNSTATS
on both tables before rerunning the statement. Try and let mw know.
Mauro.

"stabbert" <me*********@db forums.com> wrote in message
news:35******** ********@dbforu ms.com...

7) RQUERY: (Remote Query)

Cumulative Total Cost: 9360.27

Cumulative CPU Cost: 4.81917e+08

Cumulative I/O Cost: 354

Cumulative Re-Total Cost: 505.361

Cumulative Re-CPU Cost: 4.77279e+08

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 25.0561

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 355

Remote communication cost: 143984

Arguments:

---------

CSERQY : (Remote common subexpression)

FALSE

RMTQTXT : (Remote statement)

SELECT A0."NUMBER_1_3" , A0."NUMBER_4_6" ,
A0."NUMBER_7_9 " FROM "CBS_STG"."S_BA T_IN" A0

RMTSEVER: (Remote server)

STG_P01

STREAM : (Remote stream)

FALSE

Input Streams:

-------------

4) From Object CBS_STG.S_BAT_I N

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 53

Subquery predicate ID: Not
Applicable

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

5) To Operator #6

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Objects Used in Access Plan:

---------------------------

Schema: CBS_STG

Name: S_BAT_IN

Type: Nickname

Time of creation: 2003-10-27-
13.05.47.308142

Last statistics update:

Number of columns: 53

Number of rows: 277324

Width of rows: 18

Number of buffer pool pages: 4334

Distinct row values: No

Tablespace name:

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 32

Container extent page count: 32

Schema: BILL_DW

Name: BILL_ACCT

Type: Table

Time of creation: 2003-06-27-
08.37.51.360009

Last statistics update: 2003-10-27-
12.48.38.364203

Number of columns: 7

Number of rows: 1796172

Width of rows: 25

Number of buffer pool pages: 18913

Distinct row values: No

Tablespace name:
BILL_DW_BILL_AC CT

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 64

Container extent page count: 32

Table overflow record count: 0
--
Posted via http://dbforums.com

Nov 12 '05 #6
Hi, From the plan it seems that the smaller table is being entirely
shipped(rquery) to the federated server which is what you desire. Remember
in v72, federated does not exploit local parallelism, so that might be an
issue here.
May be you explore summary table over nickname (not too sure if its
available in v72) or create a local copy of the nickname if space is not an
issue. That is if you want to exploit local parallelism
Thanks
Aakash
"Mauro Cazzari" <ma***********@ sas.com> wrote in message
news:bo******** **@license1.unx .sas.com...
I see that a nested loop join is executed. I would make sure to run RUNSTATS on both tables before rerunning the statement. Try and let mw know.
Mauro.

"stabbert" <me*********@db forums.com> wrote in message
news:35******** ********@dbforu ms.com...

7) RQUERY: (Remote Query)

Cumulative Total Cost: 9360.27

Cumulative CPU Cost: 4.81917e+08

Cumulative I/O Cost: 354

Cumulative Re-Total Cost: 505.361

Cumulative Re-CPU Cost: 4.77279e+08

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 25.0561

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 355

Remote communication cost: 143984

Arguments:

---------

CSERQY : (Remote common subexpression)

FALSE

RMTQTXT : (Remote statement)

SELECT A0."NUMBER_1_3" , A0."NUMBER_4_6" ,
A0."NUMBER_7_9 " FROM "CBS_STG"."S_BA T_IN" A0

RMTSEVER: (Remote server)

STG_P01

STREAM : (Remote stream)

FALSE

Input Streams:

-------------

4) From Object CBS_STG.S_BAT_I N

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 53

Subquery predicate ID: Not
Applicable

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

5) To Operator #6

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )

Coordin-
ator Pa-
rtition

Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Objects Used in Access Plan:

---------------------------

Schema: CBS_STG

Name: S_BAT_IN

Type: Nickname

Time of creation: 2003-10-27-
13.05.47.308142

Last statistics update:

Number of columns: 53

Number of rows: 277324

Width of rows: 18

Number of buffer pool pages: 4334

Distinct row values: No

Tablespace name:

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 32

Container extent page count: 32

Schema: BILL_DW

Name: BILL_ACCT

Type: Table

Time of creation: 2003-06-27-
08.37.51.360009

Last statistics update: 2003-10-27-
12.48.38.364203

Number of columns: 7

Number of rows: 1796172

Width of rows: 25

Number of buffer pool pages: 18913

Distinct row values: No

Tablespace name:
BILL_DW_BILL_AC CT

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 64

Container extent page count: 32

Table overflow record count: 0
--
Posted via http://dbforums.com


Nov 12 '05 #7
Here is some more information:

the big table (CBS) has to be brought to the coordinator to do the join.
This is the best we can do in db2_v72. The table scan on CBS can be turned
into index scan, but dont know how much it will help performance. The index
scan helps if it is on the inner of nljn and it is used to retrieve only
limited number of rows because of index start-stop predicates.

Thanks, Aakash

"Aakash Bordia" <a_******@hotma il.com> wrote in message
news:bo******** **@hanover.toro lab.ibm.com...
Hi, From the plan it seems that the smaller table is being entirely
shipped(rquery) to the federated server which is what you desire. Remember
in v72, federated does not exploit local parallelism, so that might be an
issue here.
May be you explore summary table over nickname (not too sure if its
available in v72) or create a local copy of the nickname if space is not an issue. That is if you want to exploit local parallelism
Thanks
Aakash
"Mauro Cazzari" <ma***********@ sas.com> wrote in message
news:bo******** **@license1.unx .sas.com...
I see that a nested loop join is executed. I would make sure to run

RUNSTATS
on both tables before rerunning the statement. Try and let mw know.
Mauro.

"stabbert" <me*********@db forums.com> wrote in message
news:35******** ********@dbforu ms.com...

7) RQUERY: (Remote Query)

Cumulative Total Cost: 9360.27

Cumulative CPU Cost: 4.81917e+08

Cumulative I/O Cost: 354

Cumulative Re-Total Cost: 505.361

Cumulative Re-CPU Cost: 4.77279e+08

Cumulative Re-I/O Cost: 0

Cumulative First Row Cost: 25.0561

Cumulative Comm Cost: 0

Cumulative First Comm Cost: 0

Estimated Bufferpool Buffers: 355

Remote communication cost: 143984

Arguments:

---------

CSERQY : (Remote common subexpression)

FALSE

RMTQTXT : (Remote statement)

SELECT A0."NUMBER_1_3" , A0."NUMBER_4_6" ,
A0."NUMBER_7_9 " FROM "CBS_STG"."S_BA T_IN" A0

RMTSEVER: (Remote server)

STG_P01

STREAM : (Remote stream)

FALSE

Input Streams:

-------------

4) From Object CBS_STG.S_BAT_I N

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )
Coordin- ator Pa- rtition
Number of columns: 53

Subquery predicate ID: Not
Applicable

Partition Column Names:

----------------------

+NONE

Output Streams:

--------------

5) To Operator #6

Estimated number of rows: 277324

Partition Map ID: -100

Partitioning: (COOR )
Coordin- ator Pa- rtition
Number of columns: 3

Subquery predicate ID: Not
Applicable

Column Names:

------------

+NUMBER_7_9+NUM BER_4_6+NUMBER_ 1_3

Partition Column Names:

----------------------

+NONE

Objects Used in Access Plan:

---------------------------

Schema: CBS_STG

Name: S_BAT_IN

Type: Nickname

Time of creation: 2003-10-27-
13.05.47.308142

Last statistics update:

Number of columns: 53

Number of rows: 277324

Width of rows: 18

Number of buffer pool pages: 4334

Distinct row values: No

Tablespace name:

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 32

Container extent page count: 32

Schema: BILL_DW

Name: BILL_ACCT

Type: Table

Time of creation: 2003-06-27-
08.37.51.360009

Last statistics update: 2003-10-27-
12.48.38.364203

Number of columns: 7

Number of rows: 1796172

Width of rows: 25

Number of buffer pool pages: 18913

Distinct row values: No

Tablespace name:
BILL_DW_BILL_AC CT

Tablespace overhead: 24.100000

Tablespace transfer rate: 0.900000

Prefetch page count: 64

Container extent page count: 32

Table overflow record count: 0
--
Posted via http://dbforums.com



Nov 12 '05 #8

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

Similar topics

3
2954
by: Terry | last post by:
Hi All, Im trying to run db2expln over some sql in order to find out why its so slow. I receive the following error message. LINE MESSAGES FOR DYNEXPLN.sqc ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress.
0
1761
by: Joerg Ammann | last post by:
hi, os: aix 4.3.3 DB2: version 7 FP3 we are using a federated DB setup, datasource and fed-Db are both V7FP3 (in fact they are on the same server) and are having massiv performance problems. i tracked it back to the way the queries are push-downed to the
1
1990
by: RdR | last post by:
Hi, I have a table in SQL Server with no keys, I point this as a federated table in DB2 but in DB2 I have defined keys against this federated table in SQL. Where will the key constraints be followed in DB2 or in SQL? How should a select statement in DB2 for this federated table behave if there are duplicates in SQL? The result I am getting is it is showing an actual duplicate in DB2 for this federated table. Is there any setting in DB2...
1
1943
by: Terry | last post by:
Problem: ========= Unknown column appearing in federated tables. Description: ============ Local database (L) is an established 'federated' database, extracting values from multiple remote databases. Database server = DB2/LINUX 7.1.0
4
606
by: uthuras | last post by:
Greetings all, Is it possible to have federated db feature implemented among DB2 family? I intend to create federated within DB2 databases. I have 2 databases TestA and TestB. I have some base tables in TestA database and the reference tables in TestB database. Now i want to select data from TestB database referencing base table in TestA database. One of the way would be Federated Database. I've seen some red books on setting up...
5
3713
by: Alias | last post by:
Hi Guys , I am trying to create a federated database link between 2 UDB 8.1 databases running on AIX on the same box but under different instances. When i tried this thru the control centre , I got this error : ***************************************************** SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE=42705 *****************************************************
5
3331
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by definition? Thanks Klemens
2
5247
by: Tim V. | last post by:
Here's the layout: AIX v5.2, DB2 v8 fp8 running in 64bit I've got a Multi-partitioned db running on lpar4 and I want to connect it to 2 instances running on lpar13. We'll deal with just 1 instance on lpar13 for now. lpar4 -> db name dwdb lpar13 -> db name IBMEDGE On lpar13, I have a userid that has DBADMIN authority.
4
3446
by: Praveen_db2 | last post by:
Hi All DB2 8.1.3,Windows I have 2 databases in a single instance, say DB_1 and DB_2.I need to query a table from DB_1 in DB_2.I am try to use a nickname for it.But nickname creation is not possible until federated server is made.Please tell me how to create a federated server.Moreover, is there any thing extra which I need to buy for this?When I gave this command to create a server CREATE SERVER "TEST1" TYPE DB2/UDB VERSION 8.1
0
8315
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8608
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.