Computed Column Performance/Static Value

  • We're using SQL Server 2005 Enterprise/Standard; it depends on the server. My question is regarding the use of a computed column in a table that supports a Web Page search functionality.

    We have two columns, JobDescription Varchar(max) and JobDescription_short Computed, varchar(350). The data for this table is imported from another database where the JobDescription_short could be populated initially by using the Substring() function.

    When a person does a search on the web page for a job, they have the option to get a Summary (JobDescription_short) or Detailed (JobDescription) version of the jobs thar are returned back.

    So, how much performance is it costing our system when the Summary version of the job is being returned everytime a Job Search is returned? I'm wondering if the developer should be shortening the description prior to the import. The cost in doing that is space.

  • Is it persisted, and can you show us the DDL that builds this table via script? That'll help.

    You've already got a varchar(max) column in line with other data. I personally wouldn't be thinking space here to be the problem until you redesign entirely, so I'd actually hard save the data unless there tends to be a lot of description edits.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • The computed column is persisted.

    [jobdescription_short] AS (CONVERT([varchar](350),[jobdescription],(0))) PERSISTED,

Viewing 3 posts - 1 through 2 (of 2 total)

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