DB2 - Problembeschreibung
Problem IT27908 | Status: Geschlossen |
THE PERFORMANCE CAN BE SUB-OPTIMAL WHEN MAX IS USED AS A LAST HEAD EXPRESSION IN A QUERY. | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / B10 - DB2 | |
Problembeschreibung: | |
The query performance can be sub-optimal when it meets the following condition; 1) It's a simple SELECT 2) It has at lest 2 MIN or MAX aggregation. 3) The MAX is the last head expression 4) The alias is used instead of the real table name. For instance, to reproduce; CREATE TABLE TEST ("TEST_ID" DECIMAL(14,0) ,"TEST_DT" DATE ); CREATE ALIAS TEST_CURRENT FOR TABLE TEST; SELECT MAX(TEST_DT), MIN(TEST_DT) FROM TEST_CURRENT WITH UR SELECT MIN(TEST_DT), MAX(TEST_DT) FROM TEST_CURRENT WITH UR" - Slower than above When you run the queries above and get an execution plan, we will find that "IS NOT NULL" is added to MAX in the first query which is a good case, but not in the second query. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * All Db2 Users * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to Db2 11.1.4.5 or later * **************************************************************** | |
Local-Fix: | |
Rewrite the query so that the MAX is first or use the table name instead of the Alias. | |
Lösung | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 29.01.2019 01.04.2020 01.04.2020 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
Problem behoben lt. FixList in der Version |