Slow queries to INFORMATION_SCHEMA after upgrade to SQL 2022

Alexmssql@gmail.com 5 Reputation points
2024-06-21T17:36:25.5733333+00:00

Hello!

We have a Microsoft SQL Server 2022 (RTM-CU12-GDR) (KB5036343) - 16.0.4120.1 (X64)

Mar 18 2024 12:02:14 

Copyright (C) 2022 Microsoft Corporation

Developer Edition (64-bit) on Linux (Ubuntu 22.04.4 LTS) <X64>

We are selecting a scalar function from the application, with the following statement inside:

DECLARE @InformationSchema table

(Table_Name sysname, Column_Name sysname)

INSERT INTO @InformationSchema

SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS OPTION (RECOMPILE)

It works from SSMS, the statement itself, select from function.

But it stuck when run from application on the above simple query with the wait PREEMPTIVE_OS_QUERYREGISTRY for hours.

I am confused... It worked perfectly before migration to SQL 2022 on Ubuntu

Any ideas?

Thank you.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,277 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
65 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LiHongMSFT-4306 25,571 Reputation points
    2024-06-24T02:32:08.88+00:00

    Hi @Alexmssql@gmail.com

    But it stuck when run from application on the above simple query with the wait PREEMPTIVE_OS_QUERYREGISTRY for hours.

    Just this specific query performance slow? Have you checked the query plan?

    For more details about performance of SQL Server on Linux, see below tech docs:

    Performance best practices and configuration guidelines for SQL Server on Linux;

    Walkthrough for the performance features of SQL Server on Linux.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".