Missing numbers in a series

  • wiltc-836148 (9/8/2011)


    Jeff Moden (9/8/2011)


    It seems to me, that the only thing I could take out is the line

    GapEnd = hi.MyID - 1

    which would have little effect on performance...

    Am I missing something?

    Thanks again!

    Charles

    I meant "much quicker than the Tally Table join. The only other thing to do other than removing the code you pointed out would be to add TOP 1 to the SELECT to return just the first occurance of a GAP START.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (9/8/2011)


    I meant "much quicker than the Tally Table join. The only other thing to do other than removing the code you pointed out would be to add TOP 1 to the SELECT to return just the first occurance of a GAP START.

    Ok, TOP 1 I understood 🙂

    Actually in my testing the tally table has been faster...

    But

    1) I'm using DB2 for i

    2) My number range is only 1-99999..

    Thanks for your help!

    Charles

Viewing 2 posts - 61 through 61 (of 61 total)

You must be logged in to reply to this topic. Login to reply