What is 'Log Memory' in Query Store 2017Production SQL Server High CPU for a Single QueryTroubleshooting SOS_SCHEDULER_YIELD waitWhy does removing a RID by creating a clustered index lose parallelism and slow down execution by 2XAggregation Operations on View Ignores IndexQuery against sys.schemas and sys.synonyms runs very slow for one userRunning query against DMVs for Query Stats and Execution Plans joined to sys.databasesWhat interval does SQL Server Profiler's “duration” refer to?high writelog wait on OLTP system and fast SSD storage, log flush is slowSQL Server's “Total Server Memory” consumption stagnant for months with 64GB+ more availableWhy is selecting all resulting columns of this query faster than selecting the one column I care about?

How does a sound wave propagate?

Are small insurances worth it?

Professor forcing me to attend a conference, I can't afford even with 50% funding

Was it really inappropriate to write a pull request for the company I interviewed with?

Too soon for a plot twist?

Can I negotiate a patent idea for a raise, under French law?

Is it a Cyclops number? "Nobody" knows!

Did Amazon pay $0 in taxes last year?

ESPP--any reason not to go all in?

Create chunks from an array

What is the orbit and expected lifetime of Crew Dragon trunk?

How to install "rounded" brake pads

Rationale to prefer local variables over instance variables?

What is better: yes / no radio, or simple checkbox?

What exactly is the meaning of "fine wine"?

How to make sure I'm assertive enough in contact with subordinates?

If nine coins are tossed, what is the probability that the number of heads is even?

Should we avoid writing fiction about historical events without extensive research?

What is the oldest European royal house?

Boss Telling direct supervisor I snitched

Short story about an infectious indestructible metal bar?

School performs periodic password audits. Is my password compromised?

How can I portion out frozen cookie dough?

Generating a list with duplicate entries



What is 'Log Memory' in Query Store 2017


Production SQL Server High CPU for a Single QueryTroubleshooting SOS_SCHEDULER_YIELD waitWhy does removing a RID by creating a clustered index lose parallelism and slow down execution by 2XAggregation Operations on View Ignores IndexQuery against sys.schemas and sys.synonyms runs very slow for one userRunning query against DMVs for Query Stats and Execution Plans joined to sys.databasesWhat interval does SQL Server Profiler's “duration” refer to?high writelog wait on OLTP system and fast SSD storage, log flush is slowSQL Server's “Total Server Memory” consumption stagnant for months with 64GB+ more availableWhy is selecting all resulting columns of this query faster than selecting the one column I care about?













2















In SQL 2017 there is a new execution metric, 'Log memory' other than that it was added in 2017 I am not finding anything about it.



Execution metric: (SQL 2017)




CPU time, Duration, Execution Count, Logical Reads, Logical writes, Memory consumption, Physical Reads, CLR time, Degree of Parallelism (DOP), Row count, Log memory, TempDB memory, and Wait times




I believe I understand what all the other metrics are and why I might care.



I ran all the metrics for the top 5 resource consuming queries, during several specific periods. I recorded and now I am examining the results. I know the (very large) values for 'Log memory' are in KB's.



What exactly is the metric 'Log memory'?










share|improve this question






















  • I found a similar unanswered question on SO MSSQL - Log Memory Used - Query Store

    – James Jenkins
    10 hours ago















2















In SQL 2017 there is a new execution metric, 'Log memory' other than that it was added in 2017 I am not finding anything about it.



Execution metric: (SQL 2017)




CPU time, Duration, Execution Count, Logical Reads, Logical writes, Memory consumption, Physical Reads, CLR time, Degree of Parallelism (DOP), Row count, Log memory, TempDB memory, and Wait times




I believe I understand what all the other metrics are and why I might care.



I ran all the metrics for the top 5 resource consuming queries, during several specific periods. I recorded and now I am examining the results. I know the (very large) values for 'Log memory' are in KB's.



What exactly is the metric 'Log memory'?










share|improve this question






















  • I found a similar unanswered question on SO MSSQL - Log Memory Used - Query Store

    – James Jenkins
    10 hours ago













2












2








2


1






In SQL 2017 there is a new execution metric, 'Log memory' other than that it was added in 2017 I am not finding anything about it.



Execution metric: (SQL 2017)




CPU time, Duration, Execution Count, Logical Reads, Logical writes, Memory consumption, Physical Reads, CLR time, Degree of Parallelism (DOP), Row count, Log memory, TempDB memory, and Wait times




I believe I understand what all the other metrics are and why I might care.



I ran all the metrics for the top 5 resource consuming queries, during several specific periods. I recorded and now I am examining the results. I know the (very large) values for 'Log memory' are in KB's.



What exactly is the metric 'Log memory'?










share|improve this question














In SQL 2017 there is a new execution metric, 'Log memory' other than that it was added in 2017 I am not finding anything about it.



Execution metric: (SQL 2017)




CPU time, Duration, Execution Count, Logical Reads, Logical writes, Memory consumption, Physical Reads, CLR time, Degree of Parallelism (DOP), Row count, Log memory, TempDB memory, and Wait times




I believe I understand what all the other metrics are and why I might care.



I ran all the metrics for the top 5 resource consuming queries, during several specific periods. I recorded and now I am examining the results. I know the (very large) values for 'Log memory' are in KB's.



What exactly is the metric 'Log memory'?







sql-server sql-server-2017 query-store






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 11 hours ago









James JenkinsJames Jenkins

1,81121941




1,81121941












  • I found a similar unanswered question on SO MSSQL - Log Memory Used - Query Store

    – James Jenkins
    10 hours ago

















  • I found a similar unanswered question on SO MSSQL - Log Memory Used - Query Store

    – James Jenkins
    10 hours ago
















I found a similar unanswered question on SO MSSQL - Log Memory Used - Query Store

– James Jenkins
10 hours ago





I found a similar unanswered question on SO MSSQL - Log Memory Used - Query Store

– James Jenkins
10 hours ago










2 Answers
2






active

oldest

votes


















5














If we look at the documentation for the underlying object, sys.query_store_runtime_stats, we'll see it has the following descriptions:




  • avg_log_bytes_used - Average number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
    Note: Azure SQL Data Warehouse will always return zero (0).


  • last_log_bytes_used - Number of bytes in the database log used by the last execution of the query plan, within the aggregation interval. Applies only to Azure SQL Database.
    Note: Azure SQL Data Warehouse will always return zero (0).


  • min_log_bytes_used - Minimum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
    Note: Azure SQL Data Warehouse will always return zero (0).


  • max_log_bytes_used - Maximum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
    Note: Azure SQL Data Warehouse will always return zero (0).


  • stdev_log_bytes_used - Standard deviation of the number of bytes in the database log used by a query plan, within the aggregation interval. Applies only to Azure SQL Database.
    Note: Azure SQL Data Warehouse will always return zero (0).





share|improve this answer






























    1














    I think LowlyDBA's answer covers what the metrics actually mean. This answer is just an additional clarifying point.



    It appears the documentation is inaccurate with regards to "Applies only to Azure SQL Database". Maybe this is an old note in the docs from before those columns made it into the on-prem product, but it is easy to get data in those columns on SQL Server 2017 Developer Edition on my laptop.



    Create a database:



    USE [master];
    GO

    CREATE DATABASE [231682];
    GO


    Enable Query Store with very impractical settings:



    ALTER DATABASE [231682] SET QUERY_STORE = ON (INTERVAL_LENGTH_MINUTES = 1);


    Do something that will generate some transaction log usage:



    USE [231682];

    CREATE TABLE dbo.Junk
    (
    Id INT NOT NULL,
    MoreJunk NVARCHAR(MAX) NOT NULL
    );

    INSERT INTO dbo.Junk
    (Id, MoreJunk)
    SELECT TOP 1000
    m.message_id, m.[text]
    FROM sys.messages m;


    Force flush to disk in case it hasn't happened yet:



    EXEC sp_query_store_flush_db;


    Voila:



    SELECT 
    qsrs.avg_log_bytes_used,
    qsrs.last_log_bytes_used,
    qsrs.min_log_bytes_used,
    qsrs.max_log_bytes_used,
    qsrs.stdev_log_bytes_used
    FROM sys.query_store_runtime_stats qsrs
    WHERE qsrs.avg_log_bytes_used > 0;


    screenshot of results with non-zero data






    share|improve this answer






















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "182"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231682%2fwhat-is-log-memory-in-query-store-2017%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5














      If we look at the documentation for the underlying object, sys.query_store_runtime_stats, we'll see it has the following descriptions:




      • avg_log_bytes_used - Average number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
        Note: Azure SQL Data Warehouse will always return zero (0).


      • last_log_bytes_used - Number of bytes in the database log used by the last execution of the query plan, within the aggregation interval. Applies only to Azure SQL Database.
        Note: Azure SQL Data Warehouse will always return zero (0).


      • min_log_bytes_used - Minimum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
        Note: Azure SQL Data Warehouse will always return zero (0).


      • max_log_bytes_used - Maximum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
        Note: Azure SQL Data Warehouse will always return zero (0).


      • stdev_log_bytes_used - Standard deviation of the number of bytes in the database log used by a query plan, within the aggregation interval. Applies only to Azure SQL Database.
        Note: Azure SQL Data Warehouse will always return zero (0).





      share|improve this answer



























        5














        If we look at the documentation for the underlying object, sys.query_store_runtime_stats, we'll see it has the following descriptions:




        • avg_log_bytes_used - Average number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
          Note: Azure SQL Data Warehouse will always return zero (0).


        • last_log_bytes_used - Number of bytes in the database log used by the last execution of the query plan, within the aggregation interval. Applies only to Azure SQL Database.
          Note: Azure SQL Data Warehouse will always return zero (0).


        • min_log_bytes_used - Minimum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
          Note: Azure SQL Data Warehouse will always return zero (0).


        • max_log_bytes_used - Maximum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
          Note: Azure SQL Data Warehouse will always return zero (0).


        • stdev_log_bytes_used - Standard deviation of the number of bytes in the database log used by a query plan, within the aggregation interval. Applies only to Azure SQL Database.
          Note: Azure SQL Data Warehouse will always return zero (0).





        share|improve this answer

























          5












          5








          5







          If we look at the documentation for the underlying object, sys.query_store_runtime_stats, we'll see it has the following descriptions:




          • avg_log_bytes_used - Average number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • last_log_bytes_used - Number of bytes in the database log used by the last execution of the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • min_log_bytes_used - Minimum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • max_log_bytes_used - Maximum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • stdev_log_bytes_used - Standard deviation of the number of bytes in the database log used by a query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).





          share|improve this answer













          If we look at the documentation for the underlying object, sys.query_store_runtime_stats, we'll see it has the following descriptions:




          • avg_log_bytes_used - Average number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • last_log_bytes_used - Number of bytes in the database log used by the last execution of the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • min_log_bytes_used - Minimum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • max_log_bytes_used - Maximum number of bytes in the database log used by the query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).


          • stdev_log_bytes_used - Standard deviation of the number of bytes in the database log used by a query plan, within the aggregation interval. Applies only to Azure SQL Database.
            Note: Azure SQL Data Warehouse will always return zero (0).






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 10 hours ago









          LowlyDBALowlyDBA

          7,13252542




          7,13252542























              1














              I think LowlyDBA's answer covers what the metrics actually mean. This answer is just an additional clarifying point.



              It appears the documentation is inaccurate with regards to "Applies only to Azure SQL Database". Maybe this is an old note in the docs from before those columns made it into the on-prem product, but it is easy to get data in those columns on SQL Server 2017 Developer Edition on my laptop.



              Create a database:



              USE [master];
              GO

              CREATE DATABASE [231682];
              GO


              Enable Query Store with very impractical settings:



              ALTER DATABASE [231682] SET QUERY_STORE = ON (INTERVAL_LENGTH_MINUTES = 1);


              Do something that will generate some transaction log usage:



              USE [231682];

              CREATE TABLE dbo.Junk
              (
              Id INT NOT NULL,
              MoreJunk NVARCHAR(MAX) NOT NULL
              );

              INSERT INTO dbo.Junk
              (Id, MoreJunk)
              SELECT TOP 1000
              m.message_id, m.[text]
              FROM sys.messages m;


              Force flush to disk in case it hasn't happened yet:



              EXEC sp_query_store_flush_db;


              Voila:



              SELECT 
              qsrs.avg_log_bytes_used,
              qsrs.last_log_bytes_used,
              qsrs.min_log_bytes_used,
              qsrs.max_log_bytes_used,
              qsrs.stdev_log_bytes_used
              FROM sys.query_store_runtime_stats qsrs
              WHERE qsrs.avg_log_bytes_used > 0;


              screenshot of results with non-zero data






              share|improve this answer



























                1














                I think LowlyDBA's answer covers what the metrics actually mean. This answer is just an additional clarifying point.



                It appears the documentation is inaccurate with regards to "Applies only to Azure SQL Database". Maybe this is an old note in the docs from before those columns made it into the on-prem product, but it is easy to get data in those columns on SQL Server 2017 Developer Edition on my laptop.



                Create a database:



                USE [master];
                GO

                CREATE DATABASE [231682];
                GO


                Enable Query Store with very impractical settings:



                ALTER DATABASE [231682] SET QUERY_STORE = ON (INTERVAL_LENGTH_MINUTES = 1);


                Do something that will generate some transaction log usage:



                USE [231682];

                CREATE TABLE dbo.Junk
                (
                Id INT NOT NULL,
                MoreJunk NVARCHAR(MAX) NOT NULL
                );

                INSERT INTO dbo.Junk
                (Id, MoreJunk)
                SELECT TOP 1000
                m.message_id, m.[text]
                FROM sys.messages m;


                Force flush to disk in case it hasn't happened yet:



                EXEC sp_query_store_flush_db;


                Voila:



                SELECT 
                qsrs.avg_log_bytes_used,
                qsrs.last_log_bytes_used,
                qsrs.min_log_bytes_used,
                qsrs.max_log_bytes_used,
                qsrs.stdev_log_bytes_used
                FROM sys.query_store_runtime_stats qsrs
                WHERE qsrs.avg_log_bytes_used > 0;


                screenshot of results with non-zero data






                share|improve this answer

























                  1












                  1








                  1







                  I think LowlyDBA's answer covers what the metrics actually mean. This answer is just an additional clarifying point.



                  It appears the documentation is inaccurate with regards to "Applies only to Azure SQL Database". Maybe this is an old note in the docs from before those columns made it into the on-prem product, but it is easy to get data in those columns on SQL Server 2017 Developer Edition on my laptop.



                  Create a database:



                  USE [master];
                  GO

                  CREATE DATABASE [231682];
                  GO


                  Enable Query Store with very impractical settings:



                  ALTER DATABASE [231682] SET QUERY_STORE = ON (INTERVAL_LENGTH_MINUTES = 1);


                  Do something that will generate some transaction log usage:



                  USE [231682];

                  CREATE TABLE dbo.Junk
                  (
                  Id INT NOT NULL,
                  MoreJunk NVARCHAR(MAX) NOT NULL
                  );

                  INSERT INTO dbo.Junk
                  (Id, MoreJunk)
                  SELECT TOP 1000
                  m.message_id, m.[text]
                  FROM sys.messages m;


                  Force flush to disk in case it hasn't happened yet:



                  EXEC sp_query_store_flush_db;


                  Voila:



                  SELECT 
                  qsrs.avg_log_bytes_used,
                  qsrs.last_log_bytes_used,
                  qsrs.min_log_bytes_used,
                  qsrs.max_log_bytes_used,
                  qsrs.stdev_log_bytes_used
                  FROM sys.query_store_runtime_stats qsrs
                  WHERE qsrs.avg_log_bytes_used > 0;


                  screenshot of results with non-zero data






                  share|improve this answer













                  I think LowlyDBA's answer covers what the metrics actually mean. This answer is just an additional clarifying point.



                  It appears the documentation is inaccurate with regards to "Applies only to Azure SQL Database". Maybe this is an old note in the docs from before those columns made it into the on-prem product, but it is easy to get data in those columns on SQL Server 2017 Developer Edition on my laptop.



                  Create a database:



                  USE [master];
                  GO

                  CREATE DATABASE [231682];
                  GO


                  Enable Query Store with very impractical settings:



                  ALTER DATABASE [231682] SET QUERY_STORE = ON (INTERVAL_LENGTH_MINUTES = 1);


                  Do something that will generate some transaction log usage:



                  USE [231682];

                  CREATE TABLE dbo.Junk
                  (
                  Id INT NOT NULL,
                  MoreJunk NVARCHAR(MAX) NOT NULL
                  );

                  INSERT INTO dbo.Junk
                  (Id, MoreJunk)
                  SELECT TOP 1000
                  m.message_id, m.[text]
                  FROM sys.messages m;


                  Force flush to disk in case it hasn't happened yet:



                  EXEC sp_query_store_flush_db;


                  Voila:



                  SELECT 
                  qsrs.avg_log_bytes_used,
                  qsrs.last_log_bytes_used,
                  qsrs.min_log_bytes_used,
                  qsrs.max_log_bytes_used,
                  qsrs.stdev_log_bytes_used
                  FROM sys.query_store_runtime_stats qsrs
                  WHERE qsrs.avg_log_bytes_used > 0;


                  screenshot of results with non-zero data







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 4 hours ago









                  jadarnel27jadarnel27

                  6,27012038




                  6,27012038



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Database Administrators Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231682%2fwhat-is-log-memory-in-query-store-2017%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Frič See also Navigation menuinternal link

                      Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant

                      fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank” The 2019 Stack Overflow Developer Survey Results Are In“tar: unrecognized option --warning” during 'apt-get install'How to fix Fontconfig errorHow do I figure out which font file is chosen for a system generic font alias?Why are some apt-get-installed fonts being ignored by fc-list, xfontsel, etc?Reload settings in /etc/fonts/conf.dTaking 30 seconds longer to boot after upgrade from jessie to stretchHow to match multiple font names with a single <match> element?Adding a custom font to fontconfigRemoving fonts from fontconfig <match> resultsBroken fonts after upgrading Firefox ESR to latest Firefox