Inserting Multiple DATE values into a column.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AK

    #16
    Re: Inserting Multiple DATE values into a column.

    Knut,
    [color=blue]
    > Besides, you could write your own table function that takes a start and end
    > date and calculates all the dates in between. Its trivial to implement and
    > has a linear run time. For my personal taste, this would be much safer.[/color]

    I think this is a matter of personal preferences. I have created a
    permanent calendar table and populated it just once, then I added
    indexes on it. It's being used all the time for frequently running
    queries like "7 business days from now" or "how many people weren't
    doing anything last Monday" and so on. I was considering a table UDF,
    but that seemed to be re-doing one and the same work over and over
    again many times every hour.

    What do you think?

    Comment

    • Knut Stolze

      #17
      Re: Inserting Multiple DATE values into a column.

      AK <ak_tiredofspam @yahoo.com> wrote:
      [color=blue]
      > Knut,
      >[color=green]
      >> Besides, you could write your own table function that takes a start and
      >> end
      >> date and calculates all the dates in between. Its trivial to implement
      >> and
      >> has a linear run time. For my personal taste, this would be much safer.[/color]
      >
      > I think this is a matter of personal preferences. I have created a
      > permanent calendar table and populated it just once, then I added
      > indexes on it. It's being used all the time for frequently running
      > queries like "7 business days from now" or "how many people weren't
      > doing anything last Monday" and so on. I was considering a table UDF,
      > but that seemed to be re-doing one and the same work over and over
      > again many times every hour.[/color]

      If you have static data, then I would (most probably) also materialize it in
      a table. It's much better if DB2 knows the kind of data it has to deal
      with in such a case.

      My thoughts on the table function just for (or rather against) the
      "performanc e of recursion might degrade exponencially".

      Also, my considerations on the stable mechanism to generate those date
      values applies primarily for the case where the values need to be generated
      more often. For a one time shot, I might not bother with something more
      complex either, and then check if anything is missing or wrong and clean it
      up manually.

      --
      Knut Stolze
      Information Integration
      IBM Germany / University of Jena

      Comment

      Working...