Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:57:52+00:00 2026-06-06T20:57:52+00:00

Possible Duplicate: Why does the Execution Plan include a user-defined function call for a

  • 0

Possible Duplicate:
Why does the Execution Plan include a user-defined function call for a computed column that is persisted?

I’ve added a persisted computed column to a table.

ALTER TABLE guest
  ADD FullName AS
  dbo.complicatedFunction(ISNULL(FirstName, N'') + ISNULL(LastName, '')) PERSISTED
GO

I also added a non-clustered index on that field.

When I do a select from that table and include the column into a where statement it takes very long to execute.

I tried replacing the persisted column with the expression directly and it takes the same amount of time to execute, which led me to believe that FullName field is being recalculated for every row when I try to select something from that table.

How can I avoid that recalculation and get the query to use the index?

Execution plan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:57:53+00:00Added an answer on June 6, 2026 at 8:57 pm

    Martin Smith posted a link to a great explanation on why this is happening, and after reading through it, I replaced a call to the UDF with it’s body and it solved my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Timeout on a Python function call I want to implement that when
Possible Duplicate: Does a finally block always run? I learned that the finally clause
Possible Duplicate: A call to PInvoke function '[…]' has unbalanced the stack I'm trying
Possible Duplicate: Does sleep time count for execution time limit? If the max execution
Possible Duplicate: What does $(function() {} ); do? what exactly does the following syntax
Possible Duplicate: Configure MPI hostsfile to use multiple user identities Does anyone know it
Possible Duplicate: Does the compiler continue evaluating an expression where all must be true
Possible Duplicate: Does anyone know of a good C# API for Subversion? I'm designing
Possible Duplicate: Does fast enumeration in Objective-C guarantee the order of iteration? Just a
Possible Duplicate: How does this CSS triangle shape work? Please help me i need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.