Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2017 September SQL Server 2016: Use dm_exec_function_stats to check Number of Execution Count of Function

SQL Server 2016: Use dm_exec_function_stats to check Number of Execution Count of Function

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

In this post, I am sharing a script to check the total execution count of function or other performance related details of function in SQL Server 2016.

SQL Server 2016 introduced dm_exec_function_stats dm view for checking the stats for user defined function.

Using this, you can check execution count, last execution time, max physical reads, max logical reads and other.

Please check the below script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
SELECT
DB_NAME(database_id) AS DatabaseName
,OBJECT_SCHEMA_NAME(OBJECT_ID, database_id) +
'.' + OBJECT_NAME(OBJECT_ID, database_id) AS FunctionName
,DEFS.execution_count
,DEFS.total_elapsed_time/DEFS.execution_count AS AvgElapsedTime
,DEFS.last_execution_time
,DEFS.max_worker_time
,DEFS.max_physical_reads
,DEFS.max_logical_reads
,DEFS.max_logical_writes
,T.Text
FROM sys.dm_exec_function_stats DEFS
CROSS APPLY sys.dm_exec_sql_text(sql_handle) T

Sep 4, 2017Anvesh Patel

Please visit other related articles...

  • SQL Server 2016: New COMPRESS and DECOMPRESS function for the Column level Compression
  • SQL Server 2016: Introduced Data Compression Algorithm to reduce the size of Table
  • SQL Server 2016: Generate the JSON formatted data from the Table Data
  • SQL Server 2016: Use STRING_ESCAPE to escape single quotes, double quotes, forward slashes
  • SQL Server 2016: Row Level Security by Example
  • SQL Server 2016: Use OPENJSON() to extract JSON data from Input Parameter
  • SQL Server 2016: Wide World Importers (WWI) – New sample database
  • SQL Server 2016: Use WITHOUT_ARRAY_WRAPPER to remove [square brackets] from JSON
SQL Server: Implement Table Partition in Non Enterprise Edition (Use Partitioned View)SQL Server 2016: Use dm_exec_session_wait_stats to check wait statistics per Session Level
Anvesh Patel

Database Engineer

September 4, 2017 SQL ServerAnvesh Patel, database, database research and development, dbrnd, dm_exec_function_stats, SQL Query, SQL Server, SQL Server 2016, SQL Server Administrator, SQL Server Error, SQL Server Monitoring, SQL Server Performance Tuning, SQL Server Programming, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... }
  • Anvesh Patel { Great... }
  • Anvesh Patel { Great... }
  • Anvesh Patel { Great... }
  • Anvesh Patel { Great... }
  • Anvesh Patel { Great... }
  • Anvesh Patel { Great... }
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....