{"id":1875,"date":"2020-09-16T07:00:00","date_gmt":"2020-09-16T04:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=1875"},"modified":"2025-04-30T13:29:51","modified_gmt":"2025-04-30T10:29:51","slug":"pos-syllegoyme-queries-me-megali-diarkeia-me","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/pos-syllegoyme-queries-me-megali-diarkeia-me\/","title":{"rendered":"How do we collect long-running queries via Extended Event and how do we read its data"},"content":{"rendered":"<p>Many times we will need to find how many and which SQL queries were executed for a long time in SQL Server. The easiest solution with the least performance impact is to create a <strong>Extended Event<\/strong>.<\/p>\n\n\n\n<p>All we need to do is create it with a T-SQL command. After it is created, it will record in the path that we have declared to it in an XML file all the queries that lasted more than one second. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">To create the Extended Event<\/h2>\n\n\n\n<p>We must not forget to change the path to the one where we want the data to be stored.<\/p>\n\n\n\n<p>Then we run it in a simple query window:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">CREATE EVENT SESSION [CaptureDuration] ON SERVER \nADD EVENT sqlserver.rpc_completed(SET collect_statement=(1)\n    ACTION(package0.collect_cpu_cycle_time,sqlos.cpu_id,sqlos.task_time,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.tsql_stack,sqlserver.username)\n    WHERE ([package0].[greater_than_equal_uint64]([duration],(10000000)))),\nADD EVENT sqlserver.sql_batch_completed(\n    ACTION(package0.collect_cpu_cycle_time,sqlos.cpu_id,sqlos.task_time,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.tsql_stack,sqlserver.username)\n    WHERE ([package0].[greater_than_equal_uint64]([duration],(10000000)))),\nADD EVENT sqlserver.sql_statement_completed(SET collect_statement=(1)\n    ACTION(package0.collect_cpu_cycle_time,sqlos.cpu_id,sqlos.task_time,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.tsql_stack,sqlserver.username)\n    WHERE ([package0].[greater_than_equal_int64]([duration],(10000000)))) \nADD TARGET package0.event_file(SET filename=N'D:\\Xevents\\longqueries_file.xel',max_file_size=(20),max_rollover_files=(50))\nWITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=ON)\nGO\n\nalter event session CaptureDuration on server state=start;\ngo\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How we read the results<\/h2>\n\n\n\n<p>In the path we defined during its creation <strong>XEvent <\/strong>a .xel and a .xem file were created. Through the dynamic view <strong>sys.fn_xe_file_target_read_file<\/strong> with parameters these files we result in all the <strong>XML <\/strong>file with the information. <\/p>\n\n\n\n<p>But since it is impractical to read an XML by eye, the file must somehow be filtered into a more readable form.<\/p>\n\n\n\n<p>So I sat down and made a query that does this job.<\/p>\n\n\n\n<p>For starters, through the name we created, Xevent finds the path that is dynamically located and defines it as a parameter in the query.<\/p>\n\n\n\n<p>Then we define the XML as one <strong>Common Table Expression<\/strong>. By doing SELECT we can get the value from each property we need.<\/p>\n\n\n\n<p>In the where statement we can filter specific bases, the duration and the period of time it was executed.<\/p>\n\n\n\n<p>This part needs attention, as the default xml timestamp is in UTC timezone, so to put the real time that the server has, we add the time difference that the server has with the UTC timezone<em> which is done with functions<\/em> (<em>DATEADD(HOUR,DATEDIFF(hour, SYSUTCDATETIME(),SYSDATETIME() )<\/em>):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">declare\n@xel as varchar(max),\n@xem as varchar(max) \n\nset @xel=(select \nSUBSTRING(cast(f.value as varchar(max)),1,len(cast(f.value as varchar(max)))-4)+'*.xel' as xel\nfrom sys.server_event_session_fields f\ninner join sys.server_event_sessions n on f.event_session_id = n.event_session_id\nWHERE f.NAME = 'filename' \nand n.name like '%CaptureDuration%') --Set xevent Name\n\nset @xem=(select \nSUBSTRING(cast(f.value as varchar(max)),1,len(cast(f.value as varchar(max)))-4)+'*.xem' as xem\nfrom sys.server_event_session_fields f\ninner join sys.server_event_sessions n on f.event_session_id = n.event_session_id\nWHERE f.NAME = 'filename' \nand n.name like '%CaptureDuration%')  --Set xevent Name\n\n;WITH XEvents AS\n(\nselect  object_name, CAST(event_data AS XML) AS A FROM sys.fn_xe_file_target_read_file(\n@xel\n,@xem\n, NULL, NULL)\n)\nSELECT \nA.value ('(\/event\/action[@name=''database_name'']\/value)[1]', 'VARCHAR(MAX)') AS DB_Name,\nDATEADD(HOUR,DATEDIFF(hour,  SYSUTCDATETIME(),SYSDATETIME() ),A.value ('(\/event\/@timestamp)[1]', 'DATETIME')) AS [Time],\nA.value ('(event\/data[@name=\"duration\"]\/value)[1]','bigint') \/ 1000000  AS [Duration_Seconds],\nA.value ('(\/event\/action[@name=''sql_text'']\/value)[1]', 'VARCHAR(MAX)') AS sql_text,\nA.value ('(\/event\/action[@name=''client_hostname'']\/value)[1]', 'VARCHAR(MAX)') AS client_hostname,\nA.value ('(\/event\/action[@name=''client_app_name'']\/value)[1]', 'VARCHAR(MAX)') AS client_app_name,\nA.value ('(\/event\/action[@name=''nt_username'']\/value)[1]', 'VARCHAR(MAX)') AS nt_username,\nA.value ('(\/event\/action[@name=''username'']\/value)[1]', 'VARCHAR(MAX)') AS username,\n--,A.value('(event\/data[@name=\"cpu_time\"]\/value)[1]','bigint') \/1000000 AS cpu_seconds\n--,A.value('(event\/data[@name=\"physical_reads\"]\/value)[1]','bigint') AS physical_reads\n--,A.value('(event\/data[@name=\"logical_reads\"]\/value)[1]','bigint') AS logical_reads\n--,A.value('(event\/data[@name=\"row_count\"]\/value)[1]','bigint') AS row_count\nA   AS xml_report\nFrom XEvents\nwhere  1=1\n\nand DATEADD(HOUR,DATEDIFF(hour,  SYSUTCDATETIME(),SYSDATETIME() ),A.value ('(\/event\/@timestamp)[1]', 'DATETIME'))  between '2020-05-20 10:45:00.000' and '2020-05-22 12:45:00.000'\nand A.value ('(\/event\/action[@name=''database_name'']\/value)[1]', 'VARCHAR(MAX)') ='DBATools'\nand A.value('(event\/data[@name=\"duration\"]\/value)[1]','bigint') \/ 1000000  >= 15 --sec<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">The result<\/h2>\n\n\n\n<p>The result of the query brought us for this period of time to the database that we asked for the queries that were running and their duration:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"86\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/09\/xevents_1.png\" alt=\"\" class=\"wp-image-1877\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/09\/xevents_1.png 675w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/09\/xevents_1-300x38.png 300w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><\/figure>\n\n\n\n<p>Accordingly, to keep the blockings, we can follow the steps listed in <a href=\"https:\/\/www.dataplatform.gr\/en\/pos-syllegoyme-blocking-queries-meso-extended-event-kai-pos-diav\/\" target=\"_blank\" rel=\"noreferrer noopener\">this<\/a> the article. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sources:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/extended-events\/quick-start-extended-events-in-sql-server?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">Quickstart: Extended Events in SQL Server<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Many times we will need to find how many and which SQL queries were executed for a long time in a period of time in SQL Server. The easiest solution with the least performance impact is to create an Extended Event. All we need to do is create it with a T-SQL command. Once created, it will [...]<\/p>","protected":false},"author":1,"featured_media":702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15],"tags":[29,99,23,48,39,6],"class_list":["post-1875","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ms-sqlserver","tag-databases","tag-extended-events","tag-microsoft","tag-performance_tuning","tag-sql","tag-sqlserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5 - DataPlatform.gr<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dataplatform.gr\/en\/pos-syllegoyme-queries-me-megali-diarkeia-me\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5 - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u03a0\u03bf\u03bb\u03bb\u03ad\u03c2 \u03c6\u03bf\u03c1\u03ad\u03c2 \u03b8\u03b1 \u03c7\u03c1\u03b5\u03b9\u03b1\u03c3\u03c4\u03b5\u03af \u03bd\u03b1 \u03b2\u03c1\u03bf\u03cd\u03bc\u03b5 \u03c0\u03cc\u03c3\u03b1 \u03ba\u03b1\u03b9 \u03c0\u03bf\u03b9\u03b1 SQL queries \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03c4\u03b7\u03ba\u03b1\u03bd \u03b3\u03b9\u03b1 \u03bc\u03af\u03b1 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03c3\u03b5 \u03ad\u03bd\u03b1 \u03c7\u03c1\u03bf\u03bd\u03b9\u03ba\u03cc \u03b4\u03b9\u03ac\u03c3\u03c4\u03b7\u03bc\u03b1 \u03c3\u03c4\u03bf\u03bd SQL Server. \u0397 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b7 \u03bb\u03cd\u03c3\u03b7 \u03bc\u03b5 \u03c4\u03bf \u03bb\u03b9\u03b3\u03cc\u03c4\u03b5\u03c1\u03bf performance impact \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b5\u03bd\u03cc\u03c2 Extended Event. \u03a4\u03bf \u03bc\u03cc\u03bd\u03bf \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b5\u03b9\u03ac\u03b6\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bd\u03b1 \u03c4\u03bf \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b5 \u03ad\u03bd\u03b1 T-SQL command. \u0391\u03c6\u03bf\u03cd \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03b7\u03b8\u03b5\u03af, \u03b8\u03b1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/pos-syllegoyme-queries-me-megali-diarkeia-me\/\" \/>\n<meta property=\"og:site_name\" content=\"DataPlatform.gr\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dataplatform.gr\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-16T04:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-30T10:29:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stratos Matzouranis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stratos Matzouranis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5\",\"datePublished\":\"2020-09-16T04:00:00+00:00\",\"dateModified\":\"2025-04-30T10:29:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/\"},\"wordCount\":72,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"keywords\":[\"Databases\",\"Extended Events\",\"Microsoft\",\"Performance Tuning\",\"SQL\",\"SQL Server\"],\"articleSection\":[\"Databases\",\"Microsoft SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/\",\"name\":\"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5 - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"datePublished\":\"2020-09-16T04:00:00+00:00\",\"dateModified\":\"2025-04-30T10:29:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-syllegoyme-queries-me-megali-diarkeia-me\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft SQL Server\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/ms-sqlserver\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"name\":\"dataplatform.gr - Sky is not the limit!\",\"description\":\"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dataplatform.gr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\",\"name\":\"dataplatform.gr\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"width\":322,\"height\":139,\"caption\":\"dataplatform.gr\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dataplatform.gr\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dataplatform-gr\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\",\"name\":\"Stratos Matzouranis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"caption\":\"Stratos Matzouranis\"},\"sameAs\":[\"https:\\\/\\\/www.dataplatform.gr\"],\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/en\\\/author\\\/stratos-matzouranis\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5 - DataPlatform.gr","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dataplatform.gr\/en\/pos-syllegoyme-queries-me-megali-diarkeia-me\/","og_locale":"en_US","og_type":"article","og_title":"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5 - DataPlatform.gr","og_description":"\u03a0\u03bf\u03bb\u03bb\u03ad\u03c2 \u03c6\u03bf\u03c1\u03ad\u03c2 \u03b8\u03b1 \u03c7\u03c1\u03b5\u03b9\u03b1\u03c3\u03c4\u03b5\u03af \u03bd\u03b1 \u03b2\u03c1\u03bf\u03cd\u03bc\u03b5 \u03c0\u03cc\u03c3\u03b1 \u03ba\u03b1\u03b9 \u03c0\u03bf\u03b9\u03b1 SQL queries \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03c4\u03b7\u03ba\u03b1\u03bd \u03b3\u03b9\u03b1 \u03bc\u03af\u03b1 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03c3\u03b5 \u03ad\u03bd\u03b1 \u03c7\u03c1\u03bf\u03bd\u03b9\u03ba\u03cc \u03b4\u03b9\u03ac\u03c3\u03c4\u03b7\u03bc\u03b1 \u03c3\u03c4\u03bf\u03bd SQL Server. \u0397 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b7 \u03bb\u03cd\u03c3\u03b7 \u03bc\u03b5 \u03c4\u03bf \u03bb\u03b9\u03b3\u03cc\u03c4\u03b5\u03c1\u03bf performance impact \u03b5\u03af\u03bd\u03b1\u03b9 \u03b7 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03af\u03b1 \u03b5\u03bd\u03cc\u03c2 Extended Event. \u03a4\u03bf \u03bc\u03cc\u03bd\u03bf \u03c0\u03bf\u03c5 \u03c7\u03c1\u03b5\u03b9\u03ac\u03b6\u03b5\u03c4\u03b1\u03b9 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bd\u03b1 \u03c4\u03bf \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b5 \u03ad\u03bd\u03b1 T-SQL command. \u0391\u03c6\u03bf\u03cd \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03b7\u03b8\u03b5\u03af, \u03b8\u03b1 [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/pos-syllegoyme-queries-me-megali-diarkeia-me\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2020-09-16T04:00:00+00:00","article_modified_time":"2025-04-30T10:29:51+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","type":"image\/png"}],"author":"Stratos Matzouranis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stratos Matzouranis","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5","datePublished":"2020-09-16T04:00:00+00:00","dateModified":"2025-04-30T10:29:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/"},"wordCount":72,"commentCount":1,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","keywords":["Databases","Extended Events","Microsoft","Performance Tuning","SQL","SQL Server"],"articleSection":["Databases","Microsoft SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/","url":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/","name":"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5 - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","datePublished":"2020-09-16T04:00:00+00:00","dateModified":"2025-04-30T10:29:51+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#primaryimage","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataplatform.gr\/pos-syllegoyme-queries-me-megali-diarkeia-me\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/www.dataplatform.gr\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.dataplatform.gr\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Microsoft SQL Server","item":"https:\/\/www.dataplatform.gr\/category\/databases\/ms-sqlserver\/"},{"@type":"ListItem","position":4,"name":"\u03a0\u03ce\u03c2 \u03c3\u03c5\u03bb\u03bb\u03ad\u03b3\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 queries \u03bc\u03b5 \u03bc\u03b5\u03b3\u03ac\u03bb\u03b7 \u03b4\u03b9\u03ac\u03c1\u03ba\u03b5\u03b9\u03b1 \u03bc\u03ad\u03c3\u03c9 Extended Event \u03ba\u03b1\u03b9 \u03c0\u03c9\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c4\u03bf\u03c5"}]},{"@type":"WebSite","@id":"https:\/\/www.dataplatform.gr\/#website","url":"https:\/\/www.dataplatform.gr\/","name":"dataplatform.gr - Sky is not the limit!","description":"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.","publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataplatform.gr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dataplatform.gr\/#organization","name":"dataplatform.gr","url":"https:\/\/www.dataplatform.gr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","width":322,"height":139,"caption":"dataplatform.gr"},"image":{"@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dataplatform.gr\/","https:\/\/www.linkedin.com\/company\/dataplatform-gr\/"]},{"@type":"Person","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf","name":"Stratos Matzouranis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","caption":"Stratos Matzouranis"},"sameAs":["https:\/\/www.dataplatform.gr"],"url":"https:\/\/www.dataplatform.gr\/en\/author\/stratos-matzouranis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/1875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/comments?post=1875"}],"version-history":[{"count":2,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/1875\/revisions"}],"predecessor-version":[{"id":5825,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/1875\/revisions\/5825"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media\/702"}],"wp:attachment":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media?parent=1875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=1875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=1875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}