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 565853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:54:56+00:00 2026-05-13T12:54:56+00:00

I have a great bunch of sql server statements that run on sql server

  • 0

I have a great bunch of sql server statements that run on sql server 2008
I try to inspect its execution plans.
Actually it generates a great deal of execution plans.
I want to show only the execution plans that have a specific operator(s).
e.g I want to get the execution plans that have Table Scan operator.

Any way to do something like this?

thank you in advance.

  • 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-05-13T12:54:57+00:00Added an answer on May 13, 2026 at 12:54 pm

    Answered this a while back (Searching for table/index scans)

    WITH XMLNAMESPACES(DEFAULT N'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
    CachedPlans
    (
    ParentOperationID,
    OperationID,
    PhysicalOperator,
    LogicalOperator,
    EstimatedCost,
    EstimatedIO,
    EstimatedCPU,
    EstimatedRows,
    PlanHandle,
    QueryText,
    QueryPlan,
    CacheObjectType,
    ObjectType)
    AS
    (
    SELECT
    RelOp.op.value(N'../../@NodeId', N'int') AS ParentOperationID,
    RelOp.op.value(N'@NodeId', N'int') AS OperationID,
    RelOp.op.value(N'@PhysicalOp', N'varchar(50)') AS PhysicalOperator,
    RelOp.op.value(N'@LogicalOp', N'varchar(50)') AS LogicalOperator,
    RelOp.op.value(N'@EstimatedTotalSubtreeCost ', N'float') AS EstimatedCost,
    RelOp.op.value(N'@EstimateIO', N'float') AS EstimatedIO,
    RelOp.op.value(N'@EstimateCPU', N'float') AS EstimatedCPU,
    RelOp.op.value(N'@EstimateRows', N'float') AS EstimatedRows,
    cp.plan_handle AS PlanHandle,
    st.TEXT AS QueryText,
    qp.query_plan AS QueryPlan,
    cp.cacheobjtype AS CacheObjectType,
    cp.objtype AS ObjectType
    FROM sys.dm_exec_cached_plans cp
    CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) st
    CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
    CROSS APPLY qp.query_plan.nodes(N'//RelOp') RelOp (op)
    )
    SELECT
    PlanHandle,
    ParentOperationID,
    OperationID,
    PhysicalOperator,
    LogicalOperator,
    QueryText,
    CacheObjectType,
    ObjectType,
    EstimatedCost,
    EstimatedIO,
    EstimatedCPU,
    EstimatedRows
    FROM CachedPlans
    WHERE CacheObjectType = N'Compiled Plan'
    and
    (PhysicalOperator = 'Clustered Index Scan' or PhysicalOperator = 'Table Scan' 
    or PhysicalOperator = 'Index Scan')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem. I have a SQL Server table that stores a bunch
I've got an IronPython script that executes a bunch of SQL statements against a
I have a bunch of sites that work great with nginx + php-fastcgi and
Scenario: We have a great deal of server environmental information (names, IPs, roles, firewall
I have an asp.net-mvc3 website using nhibernate and SQL server. I have 2 web
Normally the parameterized SQL works great for CRUD, but I have one instance where
I have a bunch of RTP packets that I'd like to re-assemble into an
I had a bunch of apps that worked great in iOS 4. None of
We have a couple of winforms applications that host a bunch of icons in
I have a form that will be populated by a bunch of information from

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.