Causes for The query processor could not produce a query plan

  • SQL Server 2016 (13.0.5598.27)

    The first version of the below query produces results while the second results in the Query Plan error listed below. What can cause this?  Every article I've found so far about this is always about how the query is structured. In my case its about the value being queried on; 1 versus 2. The below is just a mock up but my actual query (which i can't share) is literally this simple. I've already updated the statistics and rebuilt the indexes on the tables.   Thoughts?

    SELECT T1.* 
    FROM TABLE1 T1 Join TABLE2 T2 ON T1.PrimaryKeyCol = T2.ForeignKeyColumn
    WHERE T1.Column1 = 1

    SELECT T1.*
    FROM TABLE1 T1 Join TABLE2 T2 ON T1.PrimaryKeyCol = T2.ForeignKeyColumn
    WHERE T1.Column1 = 2

    Msg 8624, Level 16, State 116, Line 53

    Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.

    Kindest Regards,

    Just say No to Facebook!
  • Seems crazy to me.  Just out of curiosity, have you tried using the old cardinality estimator settings?  You may have found a genuine bug with the new one.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I would look at the stats on that table and see if they are up to date.  If they are up to date - then I would look at the histogram to see what the distribution of data actually is for those two values.

    Further to that - take a look at the following settings:

    Server: 'Optimize for Adhoc Workloads'

    Database: Parameterization

    See if you can get an actual execution plan for the first query...and if possible get the estimated execution plan for the second one.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • I've seen a few places report  SET QUOTED IDENTIFIER ON fixed things.

    Multiple reports from SQL Agent, but it might apply here.

    https://joyfulcraftsmen.com/blog/internal-query-processor-error-debugged/

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

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