ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Index Column Order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Index Column Order

    I have a simple join statement
    Code:
    SELECT LO.ID
    INTO   : H
    FROM   QTEMP / TBLA GR
           LEFT OUTER JOIN TBLB AS LO
           ON     GR .A = LO.A
           AND    GR .B    = LO.B
           AND    GR .C = LO.C
           AND    GR .D    = LO.D
           AND    GR .E    = LO.E
           AND    GR .F = LO.F
    The indexes are
    TBLA (A,B,C,D,E,F)
    TBLB (A,B,C,D,E,F)

    When I look at the advised indexes it comes up with index (F,E,D,C,A,B) for TBLB but none for TBLA. Why does it want the columns in a different order? What am I missing? Working with the statement in visual explain it says its doing index probes so everything seems to be in place.

    Click image for larger version

Name:	image.bmp
Views:	1
Size:	239.5 KB
ID:	127909

  • #2
    Re: Index Column Order

    It could be one of a billion reasons (due to the advisor getting smarter) but its likely because the advisor has determined that there are fewer F to F key occurrences possible.
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: Index Column Order

      Don't know if this helps.


      Column cardinality
      Code:
      A 8364
      B 11160
      C 89
      D 66
      E 29
      F 7

      Comment


      • #4
        Re: Index Column Order

        yep. SQE and the advisor are wise.
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment

        Working...
        X