Execution Plan "table Spool"

  • Hello friends

    I found table spool(Lazy) in execution plan so it is better or not?

    let me know if it is not good then how to avoid it?

  • meerack11 (8/14/2015)


    Hello friends

    I found table spool(Lazy) in execution plan so it is better or not?

    let me know if it is not good then how to avoid it?

    It depends on what the statement is doing. Folks will be guessing without sight of the actual query plan.

    โ€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.โ€ - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Further on Chris's reply, this is a high level representation of what goes on behind the scene when a query is executed, it can be good, bad or ugly but it all depends, without more complete information it's a waste of time trying to guess.

    ๐Ÿ˜Ž

    Best thing you can do to get an answer to your question is to post the actual execution plan, the DDL (create table including indices etc.) and at least some information on the data (cardinality etc.)

  • Select distinct SCode, Spec from CLEANSED_DATA

    where State ='NC' and Application_Header_ID=82 and Ntwk_ID='NCN201' and File_Type='Provider'

    and SCode not in

    (select Spec_Code from vw_Geo

    where State='NC' and File_Type='Provider' and

    Application_Header_ID=82 and NetworkID='N201'

    )

    and I have also question like what is better multiple non cluster index pr multiple column non cluster index?

  • Seconding Chris's request to see the execution plan. The query alone is not very useful.

    As for indexes: http://sqlinthewild.co.za/index.php/2010/09/14/one-wide-index-or-multiple-narrow-indexes/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 5 posts - 1 through 4 (of 4 total)

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