Beruflich Dokumente
Kultur Dokumente
Project Name
Block Name
TMAP Standard
Document Name
Function Name
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
1/37
Page
Phase
Project Name
Block Name
TMAP Standard
Document Name
Function Name
Title
Example)
SELECT T1.LASTNAME,
T2.NAME,
MAX(T3.SALARY) BEST_SALARY
FROM EMPLOYEE T1,
COMPANY T2,
SALHISTORY T3
WHERE T1.COMPANYID = T2.COMPANYID
AND T1.EMPID = T3.EMPID
AND T1.HIREDATE > ADD_MONTHS(SYSDATE, -60).....;
UPDATE EMPLOYEE
SET HIREDATE = SYSDATE,
TERMDATE = NULL
WHERE DEPTID = 105;
INSERT INTO EMPLOYEE
(EMPID,.....)
VALUES (105,....);
d.
2/37
Page
e.
Confirm the execution plan to determine the order of the table association.
f.
Reserved words for nodes in DML statements should be aligned to the right.
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
Phase
Project Name
Block Name
TMAP Standard
Function Name
Document Name
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
2. Coding Rules
2.1. Rules on Inquiry Processing
a.
b.
c.
An ORDER BY and GROUP BY clause should not target any non-key fields.
An ORDER BY and GROUP BY should be carried out on the key fields.
When unavoidable, monitor the performance and request for index configuration if necessary.
d.
e.
3/37
Page
Phase
Project Name
Block Name
TMAP Standard
Function Name
Document Name
f.
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
HAVING clause
Use a WHERE clause for a selection operation where possible.
Use HAVING only when specifying a selection condition against the result from a set operation such as BY.
g.
h.
i.
WHERE PARTSNUM != 0
- If anything else but a front concordance is specified in a part concordance search using a LIKE operator
<Use of index>
Obtain and valuate the execution plan because the usage of indexes changes by various conditions.
j.
4/37
Page
Phase
Project Name
Block Name
TMAP Standard
Document Name
k.
Function Name
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
l.
External association
Pro*C/C++ R9.2.0 and Pro*COBOL R9.2.0 do not support ANSI association syntax as an embedded SQL statement.
o.
p.
q.
5/37
Page
Phase
Project Name
Block Name
TMAP Standard
Document Name
- Frequently used SQL statements should be made into views.
6/37
Page
Function Name
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
Phase
Project Name
Block Name
TMAP Standard
Document Name
r.
7/37
Page
Function Name
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
Phase
Project Name
Block Name
TMAP Standard
Document Name
Function Name
Title
Created
3/9/2006
By
Teguh
Updated
7/3/2007
By
Dani
b.
c.
d.
b.
c.
d.
8/37
Page
***
---- NG!
---- OK!
->
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
ROLLBACK;
Pk_Logger.writeDetailToDB(.....
END;
END;
4.
->
10;
20;
30;
40;
->
CASE rec.ID
WHEN 'A' THEN product_code := 10;
WHEN 'B' THEN product_code := 20;
WHEN 'C' THEN product_code := 30;
ELSE
product_code := 40;
END CASE;
OR
product_code :=
CASE rec.ID
WHEN 'A' THEN 10
WHEN 'B' THEN 20
WHEN 'C' THEN 30
ELSE
END;
40
***
5. Use Index
<< When index is attached to COL. >>
select .... where COL * 10 = :VAL;
select .... where COL = :VAL / 100;
<< When the index consists of the following columns's sequence. >>
1) DEPT_CD
2) NAME
3) AGE
6.
---- NG!(Does not use index, for not using first column.)
---- NG!
---- NG!(Does not use index, for using "or".)
select
select
select
select
select
-------------
....
....
....
....
....
where
where
where
where
where
OK!(Uses
OK!(Uses
OK!(Uses
OK!(Uses
index)
index)
index)
index)
Do not use 'SELECT *' in your queries to reduce disk I/O and have better performance.
SELECT * FROM emp
->
SELECT
id, name
FROM emp
7.
Try to avoid wildcard characters at the beginning of a word while searching using the LIKE keyword.
SELECT
SELECT
8.
->
SELECT MIN(salary)
FROM
(
SELECT TOP 10 salary
FROM emp
ORDER BY salary DESC
) AS A
Note : Text in BLUE font is the derived table
9. Use Temporary Tables to to improve the performance of queries performing complex summarization or comparison
A GLOBAL TEMPORARY table has a persistent definition but data is not persistent and the global temporary table generates no redo or rollback information.
for (j=0; j< arList.size(); j++) {
<some process or computation here>
if (<some process> == <some value>) {
INSERT INTO TB_R_GL
->
(col1, col2col[n]) VALUES
(val1, decode(val2, "Yes", "0", "No", "1", val2), val[n]);
<some process or computation here>
}
}
This kind of processing will have performance problem if TB_R_GL have bulk of data.
Each Insert Transaction will have an overhead specially if there is already a lot
of data or extents, thus performance might be slower than before.
col[n] varchar2(50))
The on commit preserve rows clause tells the SQL engine that when a transaction
is committed the table should be cleared but not drop.
->
process minus the burden of other data that we dont need. We can also perform other
needed data manipulation or computation before inserting it in the actual table.
}
}
INSERT INTO TB_R_GL (col1, col2 col[n])
SELECT (col1, col2 col[n]) from TB_T_GL
10.
->
Once we are done with the other needed process, we can then transfer the final output
from temp. table to the actual table using the Bulk Insert.
With hints one can influence the optimizer. The usage of hints (with exception of the RULE-hint) causes Oracle to use the Cost Based optimizer.
Optimizer HINT is usually used in those rare cases where the optimizer makes an incorrect decision about the execution plan; or there is a reason
that altering the statistics of execution plan is preferred or needed.
(Note : This is usually used as a last resort only )
An example using the commonly used INDEX hint, forcing execution plan to use index.
11.
Avoid using joins that requires the DISTINCT qualifier on the SELECT list in queries
SELECT DISTINCT ar.acc_period,
FROM TB_R_AR_H ar,
TB_R_CUST_INV_H inv
WHERE ar.doc_no = inv.doc_no
ar.doc_no, ar.post_dt
12.
You can obtain commonly used hint text from Oracle documentation.
---- OK!
EXISTS makes the query faster because when the subquery has been satisfied once,
there is no need to proceed further and the next matching row can be fetched.
---- NG!
GROUP BY acct_cd
HAVING doc_no = 'doc123'
The HAVING clause filters selected rows only after all rows have been fetched.
SELECT header_id
FROM TB_R_SAP_JOURNAL
WHERE biz_scn_cd = 'OEM_EXP_ICS_RGR_GL'
AND post_sts = 'N'
HAVING COUNT(1) = 3
13.
Using a WHERE clause helps reduce overheads like sorting, summing, etc.
---- OK!
HAVING clauses should only be used when columns with summary operations
applied to them are restricted by the clause.
14.
---- OK!
---- OK!
In NOT EXISTS, nested index scans will be used in the subquery for each row in the 'emp' table.
Use multi-table insert if there is a need to insert data from one source to different target table.
INSERT INTO emp (id, name, age)
SELECT id, name, age
FROM tmpTable;
INSERT INTO dept (id, mgr)
SELECT id, mgr
FROM tmpTable;
In conventional way,
we opt to use several
-> Insert statement if we
need to Insert data in
more than 1 table.
CHECK SQL
->
QUERY
------------------------------------------------------SELECT STATEMENT
COST=
2.1 TABLE ACCESS BY INDEX ROWID Z_TEST_TBL2
3.1 INDEX RANGE SCAN IX_Z_TEST_TBL2 NON-UNIQUE
Inex search
QUERY
------------------------------------------------------SELECT STATEMENT
COST=
CHECK SQL
->
***
6. Use ROWID
SELECT empno, sal FROM EMP
WHERE id = :id
FOR UPDATE NOWAIT;
:
:
7. Use CURRENT OF
DECLARE
CURSOR c1 IS SELECT empno, job, sal
FROM emp FOR UPDATE;
:
:
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO rec ...
...
UPDATE emp SET sal = new_sal
WHERE empno = rec.empno;
END LOOP;
->
Z_TEST_TBL2
->
DECLARE
CURSOR c1 IS SELECT empno, job, sal
FROM emp FOR UPDATE;
:
:
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO rec ...
...
UPDATE emp SET sal = new_sal
WHERE CURRENT OF c1;
END LOOP;
DECRARE
TYPE TYP_C1 IS TABLE OF TEST_TBL.C1%TYPE INDEX BY BINARY_INTEGER;
TYPE TYP_C2 IS TABLE OF TEST_TBL.C2%TYPE INDEX BY BINARY_INTEGER;
DECRARE
:
:
:
:
tbl_c1 TYP_C1;
tbl_c2 TYP_C2;
BEGIN
FOR i IN 1..10000 LOOP
tbl_c1(i) := i;
tbl_c2(i) := 'name-' || TO_CHAR(i);
END LOOP;
BEGIN
:
:
:
->
COMMIT;
COMMIT;
END;
END;
22 second
1 second
9. MERGE
Use "MERGE", when insert or update to table from other table.
ex) By emp_no TOTAL_SALE is inserted or updated.
TODAY_SALES
EMP_NO
1
2
SALES
10,000
20,000
->
MONTH_SALES
EMP_NO
1
2
SALES
210,000
100,000
->
MONTH_SALES
EMP_NO
1
2
SALES
220,000
120,000
30,000
340,000
3
4
340,000
30,000
<-- INSERT
CURSOR LOOP
CURSOR c1 IS SELECT * FROM TODAY_SALES;
BEGIN
FOR rec IN c1 LOOP
BEGIN
INSERT INTO MONTH_SALES
(EMP_NO, SALES)
VALUES(rec.EMP_NO, rec.SALES);
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
UPDATE MONTH_SALES
SET SALES = SALES + rec.SALES
WHERE EMP_NO = rec.EMP_NO;
END;
END LOOP;
->
MERGE
MERGE INTO MONTH_SALES m
USING TODAY_SALES t
ON (m.EMP_NO = t.EMP_NO)
WHEN
MATCHED THEN UPDATE SET m.SALES = m.SALES + t.SALES
WHEN NOT MATCHED THEN INSERT (EMP_NO, SALES)
VALUES (t.EMP_NO, t.SALES);
Phase
MA
Project Name
Block Name
ICS
Action Sheet
Document Name
Page
Function Name
Title
25/37
Created
4/3/2007
By
FSBT) Ado
Updated
4/23/2007
By
FSBT) Ado
A20061215_01 DB Connection
Problem
Explanation
SQL Query takes too long to finish its execution. It takes more than 5 hours.
Action
Explanation
Modified and optimized the SQL Query. The execution time, from more than 5 hours, is now 6 - 7 seconds. Avoided, as much as possible, the joining of
multiple tables. Used a column-referencing individual query.
Bad / Not Recommended Sample
SELECT PARTMOD.POSTING_DATE,
Recommended Sample
SELECT X.POSTING_DATE,
PARTMOD.ORDER_TYPE,
X.ORDER_TYPE,
PARTMOD.MVMT_TYPE,
X.MVMT_TYPE,
PARTMOD.SHIPMENT_MODULE_NO,
X.SHIPMENT_MODULE_NO,
SUM(PARTMOD.PART_QTY) PART_QTY,
SUM(X.PART_QTY) PART_QTY,
SUM(PARTMOD.STD_COST) STD_COST
SUM(X.STD_COST) STD_COST
OEMEXPMOD.SHIPMENT_MODULE_NO,
OEMEXPSDOC.MVMT_TYPE,
OEMEXPSDOC.POSTING_DATE,
OEMEXPITEM.PART_QTY,
OEMEXPITEM.STD_COST,
OEMEXPITEM.PARENT_PART_ID,
OEMEXPITEM.PART_ID,
ACPRD.TYPE_CD = 2 AND
OEMLOC.LOC_ID
Phase
MA
Block Name
Document Name
Project Name
Page
Function Name
Title
26/37
Created
4/3/2007
By
FSBT) Ado
Updated
4/23/2007
By
FSBT) Ado
Phase
MA
Project Name
Block Name
ICS
Function Name
Action Sheet
Document Name
FROM TB_B_OEM_EXP_SDOCS
TB_B_OEM_EXP_SDOC_MODULE_ITEMS OEMEXPITEM,
TB_B_AC_PERIODS
Title
OEMEXPSDOC,
TB_B_OEM_EXP_SDOC_MODULE_ITEMS OEMEXPITEM,
TB_B_OEM_LOCATIONS
Page
OEMLOC,
27/37
Created
4/3/2007
By
FSBT) Ado
Updated
4/23/2007
By
FSBT) Ado
OEMEXPMOD.SHIPMENT_MODULE_NO,
avoid using
multiple tables for
joining, especially
large tables
ACPRD
(SELECT OEMEXPSDOC.MVMT_TYPE
FROM TB_B_OEM_EXP_SDOCS OEMEXPSDOC
WHERE OEMEXPMOD.OEM_SDOC_ID = OEMEXPSDOC.ID
use column
referencing
from smaller
tables
ACPRD.TYPE_CD = 2 AND
ACPRD.END_DATE)
AND ROWNUM = 1) MVMT_TYPE,
ACPRD.END_DATE AND
OEMEXPMOD.PACK_LOC_ID IN
(SELECT OEMEXPSDOC.POSTING_DATE
(SELECT ID
TB_B_PARTS PART,
TB_B_PART_MINV PMINV
use "EXIST"
clause
ACPRD.TYPE_CD = 2 AND
OEMEXPSDOC.POSTING_DATE BETWEEN ACPRD.START_DATE AND
ACPRD.END_DATE)
AND ROWNUM = 1) POSTING_DATE,
OEMEXPITEM.PART_QTY,
OEMEXPITEM.STD_COST
FROM TB_B_OEM_EXP_SDOC_MODULES
OEMEXPMOD,
TB_B_OEM_EXP_SDOC_MODULE_ITEMS OEMEXPITEM
WHERE OEMEXPITEM.SDOC_MOD_ID = OEMEXPMOD.ID) X
WHERE X.POSTING_DATE IS NOT NULL
minimal joining
tables
Phase
MA
Block Name
Document Name
Project Name
Page
Function Name
Title
28/37
Created
4/3/2007
By
FSBT) Ado
Updated
4/23/2007
By
FSBT) Ado
Phase
MA
Block Name
Document Name
Project Name
Page
Function Name
Title
29/37
Created
4/3/2007
By
FSBT) Ado
Updated
4/23/2007
By
FSBT) Ado
Phase
MA
Project Name
Block Name
FISM
Function Name
Action Sheet
Document Name
30/37
Page
Aggregation
Title
Created
6/18/2007
By
FSBT) Rhose
Updated
6/18/2007
By
FSBT) Rhose
A20070618_01 DB Connection
Problem
Explanation
Action
Explanation
Modified and optimized the SQL Query. If you have to compare String values with the field values, if you are not sure on how long the length of your String
value will be, use EXISTS instead of IN clause.
Bad / Not Recommended Sample
Recommended Sample
create global temporary table TB_T_ACC_PERIOD
(
ACC_PERIOD
VARCHAR2(20))
VALUES (?)
if (j == 0)
{
sAccPeriod = "'" + arrAcctPeriod.get(j) + "'";
} else {
if (arrAcctPeriod.size() > 0)
{
dao.keepAccPeriod(conn, arrAcctPeriod);
}
Phase
MA
Block Name
Document Name
Project Name
Page
Function Name
Title
Aggregation
31/37
Created
6/18/2007
By
FSBT) Rhose
Updated
6/18/2007
By
FSBT) Rhose
Phase
MA
Project Name
Block Name
Document Name
FISM
Function Name
Action Sheet
Aggregation
Title
Created
6/18/2007
By
FSBT) Rhose
Updated
6/18/2007
By
FSBT) Rhose
UPDATE TB_R_GL
SET STS = 1 ,
SET STS = 1 ,
OUTBOUND_IF_NAME = 'GL_OEM_EXP_ICS_RGR_JV_20070607181026_D' ,
OUTBOUND_IF_NAME = 'GL_OEM_EXP_ICS_RGR_JV_20070607181026_D' ,
UPDATE_DT = sysdate ,
UPDATE_DT = sysdate ,
UPDATE_BY = 'uusfi00'
UPDATE_BY = 'uusfi00'
32/37
Page
Phase
External Design
Block name
Document name
Project name
C Common
SQL Standards
GSPS/A-TOP
Function name
Title
Common
SQL Standards
Created
Updated
2003/5/14
2003/11/05
Page
By
By
33 / 37
FJCL) Ishikawa
FJ Tsukamoto
2. SQL Standards
SQL standards are defined in the following table. In cases where it is not possible to adhere to the GSPS/A-TOP standards, the impact on areas such as response time should be investigated
and approval obtained from CIT.
TMC details of DB2 standards are provided in the document "Revised DB2 Standards.doc".
No. GSPS/A-TOPS standards
1 EXPLAIN check results
Where SQL has been chosen, EXPLAIN must be obtained in the stand-alone test phase to check
the access path.
The results of the EXPLAIN check should satisfy the following conditions.
<1> ACCESSTYPE=I (or I1)ACCESSTYPE=N requires DBA approval)
<2> MATCHCOLS0
<3> METHOD3 must conform to ORDER BY conventions (A-TOP standard No.11)
SQL is normally modified in order to change PREFETCH=L to either PREFETCH=S or 'None'.
<4> Any JOIN other than METHOD=1 (Nested Loop Join) must be approved by DBA
Where PLAN/PACKAGE is bound in the actual environment, the EXPLAIN(YES) option
must be used for BIND processing, to obtain and store access path information.
As per right-hand column
If there is only one applicable record (or less) and exclusion is not required following extraction
If there is only one applicable row (or less), use a single SELECT rather than FETCH.
used for BIND processing, to obtain and store access path information.
Where the same SQL statement is used more than one time in a program, rather than writing
UPDATE processing when there is only one applicable record (or less) should be performed directly
using single UPDATE.
Where UPDATE processing does not require cursor positioning, update directly using
a single UPDATE.
Where update can be performed based on the cursor, specify the 'FORUPDATEOF' in the
cursor declaration.
The COLUMN name for the UPDATE should be specified after the 'OF'.
The cursor used for DELETE is FOR UPDATE OF COL name 1
To obtain some rather than all applicable rows, specify OPTIMIZE for n ROWS.
Where column functions are used, these must be coordinated among individual applications
beforehand and CIT approval must be obtained.
Normally, only restricted column functions such as MIN, MAX and COUNT should be used.
MIN, MAX may only be used in the following cases:
<1> Where MIN, MAX can be obtained using ACCESSTYPE=I1
<2> Where DB2 searches 10 records or less in order to identify MIN, MAX
(e.g.: When finding the "latest data validity start time", all KEY items should be specified as
The use of column functions should be well considered and thoroughly discussed beforehand
among individual application development teams.
equal sign conditions in the WHERE clause, and there should be no more than 10
records with "different data validity start times".)
If COUNT is used, convention 1 must be satisfied.
External Design
Block name
Document name
Phase
Project name
GSPS/A-TOP
C Common
SQL Standards
Function name
Title
Common
SQL Standards
Created
Updated
2003/5/14
2003/11/05
Page 34 / 37
By
FJCL) Ishikawa
By
FJ Tsukamoto
11
12
13
Holding FETCH cursor across commit should be implemented using the SQL WITHHOLD clause
rather than by application program logic.
Use UNCOMMITEDREAD for read-only processes where practicable.
14
15
The UNION processing is not normally allowed. Where UNION is used, EXPLAIN results
must be obtained and submitted beforehand.
As per right-hand column
16
When joining multiple conditions using AND, start with conditions that have a higher filtering ratio.
17
When joining multiple conditions using OR, start with conditions that have a lower filtering ratio.
18
External Design
Block name
Document name
Phase
Project name
GSPS/A-TOP
C Common
SQL Standards
Function name
Title
Common
SQL Standards
Created
Updated
2003/5/14
2003/11/05
20
UNION processing is not normally allowed. Where UNION is used, EXPLAIN results must be
obtained and submitted beforehand.
OR join for non-equal sign predicate in same row is written with UNION.
SELECT * FROM TB1
WHERE A:HOSTVAR1 OR A:HOSTVAR2
-SELECT * FROM TB1
WHERE A:HOSTVAR1
UNION
SELECT * FROM TB1 WHERE A:HOSTVAR2
21
For UNION, DISTINCT is performed within DB2 to prevent duplicate rows being returned.
This should be avoided because SORT is executed for DISTINCT, increasing SQL costs.
For UNION ALL, DISTINCT is not performed, so where return of duplicate rows is not a problem,
UNION ALL is used.
Page 35 / 37
By
FJCL) Ishikawa
By
FJ Tsukamoto
OR join for equal sign predicate in same row is written with IN.
SELECT COUNT(*) FROM TB1
WHERE A='10' OR A='20' OR A='30'
22
LIKE description should be replaced with IN predicate or BETWEEN predicate wherever possible.
SELECT COUNT(*) FROM TB1
WHERE A LIKE 'IBM%'
-(where final part is between '1' and '9')
SELECT COUNT(*) FROM TB1
WHERE A IN('IBM1','IBM2','IBM3',
'IBM4','IBM5','IBM6','IBM7','IBM8',
'IBM9')
or
SELECT COUNT(*) FROM TB1
WHERE A BETWEEN 'IBM1' AND 'IBM9'
23
BETWEEN is used for range predicate; AND join of non-equal sign conditions is not used.
SELECT COUNT() FROM TB1
WHERE (A'100' AND A'200'
External Design
Block name
Document name
Phase
Project name
GSPS/A-TOP
C Common
SQL Standards
Function name
Title
Common
SQL Standards
25
The cursor used to extract records selected with SQL should be closed immediately when no longer required.
(This releases LOCKs where possible, and allows other programs waiting for LOCK to begin processing.)
26
Error checking should be performed on all SQL statements, including OPEN and CLOSE as well as FETCH and UPDATE/INSERT/SELECT.
27
The column name must be explicitly stated for SELECT process (SELECT * not allowed).
Specify only necessary fetch items to be obtained by the program using SELECT and UPDATE.
28
29
30
31
BETWEEN low-val AND high-val may not be used in 1st MATCHCOLS item.
32
33
KEY-UPDATE for cluster index and type keys should not be permitted -- DELETE/INSERT used instead.
34
NULL may not be used. If there is no data, a SPACE consisting of at least 1 BLANK should be inserted.
35
36
37
Update order for RECORDs in TABLE is as per CLUSTER order within each UOW.
Necessary for exclusion control, and also to prevent DEADLOCK.
Applies to all BATCH/ONLINE DELETE/INSERT/UPDATE operations.
CLUSTER order us updated when updating RECORD after searching with secondary index.
38
39
Sub-queries are not normally allowed. DBA approval is required before using sub-queries.
Created
Updated
2003/5/14
2003/11/20
Page 36 / 37
By
FJCL) Ishikawa
By
IBM Shimizu
Phase
External Design
Block name
Document name
Project name
GSPS/A-TOP
C Common
SQL Standards
Function n
Title
Common
SQL Standards
11
Where SQL has been chosen, EXPLAIN must be obtained in the stand-alone test phase to check
the access path.
Based on the results of the EXPLAIN check, the following conditions should be satisfied.
<1> Must be Index SCAN
<2> #Key Columns0
<3> If SORT is generated, ORDER BY conventions (A-TOP standard No.11) must be satisfied
SQL is normally modified in order to change list PREFETCH to either sequential PREFETCH
or None.
<4> Any JOIN other than Nested Loop Join must be approved by DBA
Where PLAN/PACKAGE is bound in the actual environment, the EXPLAIN(YES) option must be
used for BIND processing, to obtain and store access path information.
Where column functions are used, these must be coordinated among individual applications
beforehand and CIT approval must be obtained.
Normally, only restricted column functions such as MIN, MAX and COUNT must be used.
MIN, MAX may only be used in the following cases:
<1> Where MIN, MAX can be limited using Index SCAN
<2> Where DB2 searches 10 records or less in order to determine MIN, MAX
(e.g.: When finding the "latest data validity start time", all KEY items should be specified as
equal sign conditions in the WHERE clause, and there should be no more than 10 records with
"different data validity start times".)
If COUNT is used, convention 1 must be satisfied.
The following standards are normally used for ORDER BY.
<1> Where DB2 internal SORT (determined by Insert Into Sorted Temp Table keywords in Explain)
Created
Updated
Page 37 / 37
By
FJCL) Ishikawa
By
IBM Shimizu
used for BIND processing, to obtain and store access path information.
Where column functions are used, these must be coordinated among individual
applications beforehand.
(Note that the number of SORTs is the ANSERSET (searched rows) number, not the FETCH number.
38
2003/5/14
2003/11/20