Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2014
    Posts
    1

    Unanswered: DB2 SQL query performance improvement

    Please provide me some idea to improve the performance of the below query:


    SELECT '1900-01-01-00.00.00.000000'
    INTO :DCLTABRAM.REC-INS-TS
    FROM TCSMBPM
    WHERE MLB_NR = :WS-MLBOX
    AND PRM_GRP_CD = '04'
    AND PRM_NR = '059'
    AND PRM_VLU_TE = '1'
    UNION ALL
    SELECT REC_INS_TS
    FROM TABRAMA
    WHERE AC_BAS_RTG_ENB_IR = 'Y'
    AND MLB_NR = :WS-MLBOX
    UNION ALL
    SELECT ABR_VEW_GTR_TS
    FROM TAUTLST
    WHERE MLB_NR = :WS-MLBOX
    AND AHT_TYP_CD > '00'
    AND ABR_VEW_ATH_IR = '1'
    ORDER BY 1 ASC
    FETCH FIRST ROW ONLY

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    with only this information : nobody can/will help you
    at least db2level/platform, ddl, explain...
    look at the performance tuning handbook to understand the basics of db2
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Not much to this SQL, no complexity. Do you have an index on column MLB_NR in each of the three tables?
    Dave

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •