Skip to content

get_SDA_property: server failure when number of mukey > ~1500 #431

@dylanbeaudette

Description

@dylanbeaudette

SDA reports the following error when calling get_SDA_property() to aggregate horizon-level data by mukey, when there are more than approximately 1500 unique mukey values.

Invalid query: The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

This did not happen with the temporary table strategy that we used to use, possibly related to the way resource constraints are defined in the SQL Server config. I'm not sure, but it could be that the use of CTEs causes the server to think we are interacting with too many tables (based on some setting) within a single query.

Looking over the current SQL, I think that there is room for query simplification, but we could be up against a hard limit in the way SQL server plans queries in this context.

A simple work-around is to process fewer mukey at a time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions