• HowardW (1/24/2013)


    ScottPletcher (1/24/2013)


    HowardW (1/24/2013)


    ScottPletcher (1/24/2013)


    HowardW (1/24/2013)


    There's no need to make the column persisted prior to indexing it.

    That's not necessarily always true. You might persist a column if its requires significant overhead to generate the value.

    I think you've misunderstood my comment. You need to read the whole sentence, including the bit I've highlighted. Whether it's persisted via an index or in the column definition, it's still only calculated on modification.

    I don't think you're thinking clearly about this. If it's not persisted, it has to be computed every time it's SELECTed or otherwise referenced. If that computation is a lot of overhead, it can be worthwhile to instead persist the computed value, especially if it's referenced frequently.

    Nope, I think you're not thinking clearly. How an earth would an index be able to be used if the key column was calculated on the fly during a select? Indexing a computed column persists it regardless of whether the column is marked as persisted in its definition.

    Of course indexing requires persisting. I thought everyone was clear on that.

    But you claimed, in your first quote above, there was no (never a) need to persist except to index. That's simply not true. Even if a computed column is not indexed in any way, there are times when it's still worthwhile to persist it to avoid re-computing it.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.