clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 599315 fiddles created (18765 in the last week).

CREATE TABLE [dbo].[AssessmentResponses]( [ResponseID] [int] IDENTITY(1,1) NOT NULL, [AssessmentID] [int] NOT NULL, [Respondent] [nvarchar](50) NULL, [Date] [datetime] NULL, [JsonSchema] [nvarchar](max) NULL, CONSTRAINT [PK_AssessmentResponses] PRIMARY KEY CLUSTERED ( [ResponseID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 hidden batch(es)


DECLARE @loopCount INT=0; WHILE (@loopCount < 50000 ) BEGIN DECLARE @firstname VARCHAR(50); DECLARE @cityname VARCHAR(50); DECLARE @fields VARCHAR(MAX); DECLARE @respondent INT; SELECT @respondent = CAST(RAND() * 5 + 3 as INT); DECLARE @age INT; SELECT @age = CAST(RAND() * 85 + 3 as INT); DECLARE @expenditure DECIMAL(18,2); SELECT @expenditure = ROUND(RAND(CHECKSUM(NEWID())) * (50000), 2); DECLARE @salary DECIMAL(18,2); SELECT @salary = ROUND(RAND(CHECKSUM(NEWID())) * (59000), 2); DECLARE @taxes DECIMAL(18,2); SELECT @taxes = ROUND(RAND(CHECKSUM(NEWID())) * (17000), 2); with names as ( select 'M' as gender, 'Alexander' as name union all select 'M', 'Burt' union all select 'M', 'Christopher' union all select 'M', 'Jack' union all select 'M', 'John' union all select 'M', 'Mark' union all select 'M', 'Valerio' union all select 'M', 'Lorenzo' union all select 'M', 'Ugo' union all select 'M', 'Wael' union all select 'M', 'Daniel' union all select 'M', 'Eric' union all select 'F', 'Alexandra' union all select 'F', 'Bertha' union all select 'F', 'Christine' union all select 'F', 'Daniela' union all select 'F', 'Ginevra' union all select 'F', 'Anna' union all select 'F', 'Giulia' union all select 'F', 'Chiara' union all select 'F', 'Lara' union all select 'F', 'Erica' ) SELECT @firstname =(select top 1 name from names where gender = 'M' order by newid()); with cities as ( select 'Roma' as city union all select 'New York' union all select 'Mombasa' union all select 'Nairobi' union all select 'Dakar' union all select 'Milano' union all select 'Lima' union all select 'Panama' union all select 'San Salvador' union all select 'Stone Town' ) SELECT @cityname =(select top 1 city from cities order by newid()); with fields as ( select '"question1": "id sapien. Cras dolor dolor, tempus non, lacinia at, iaculis quis,", "question2": "ipsum. Curabitur consequat, lectus sit amet luctus vulputate, nisi sem semper", "company": "Pellentesque Habitant LLP", "email": "Fusce.aliquet.magna@diameudolor.net", "question3": "sit", "personalnumber": "1619051430999", "phone": "05 41 58 43 96", "fathername": "Guinevere I. Dyer", "birthplace": "Barbados", "coordinates": "37.93981, -51.22476", "password": "MHY59WAC1BW", "question4": "Phasellus libero", "question5": "dui, nec tempus", "question6": "augue porttitor interdum.", "question7": "molestie. Sed id", "question8": "enim diam vel", "question9": "sed sem egestas blandit.", "question10": "eros nec tellus. Nunc", "question11": "rutrum non, hendrerit id,", "question12": "odio a purus. Duis", "question13": "dui.", "question14": "est", "question15": "ac", "question16": "vitae", "question17": "Curabitur", "question18": "accumsan sed,", "question19": "Sed pharetra,", "question20": "dapibus id,", "question21": "sem, vitae", "question22": "et libero.", "question23": "Cras sed", "question24": "adipiscing ligula.", "question25": "Sed molestie.", "question26": "Vestibulum ante", "question27": "parturient montes,", "question28": "Cras eu", "question29": "Aliquam rutrum", "question30": "quam quis"' as field union all select '"question1": "Aliquam fringilla cursus purus. Nullam scelerisque neque sed sem egestas blandit. Nam nulla magna, malesuada vel,", "question2": "velit in aliquet lobortis, nisi nibh lacinia orci, consectetuer euismod est arcu ac orci. Ut", "company": "Parturient Montes Nascetur Incorporated", "email": "fermentum.vel@nulla.net", "question3": "nunc id enim.", "personalnumber": "1682063023999", "phone": "06 67 98 72 27", "fathername": "Grace Pena", "birthplace": "Djibouti", "coordinates": "-54.89142, 95.83408", "password": "ZOA94DJE0VS", "question4": "Nunc sollicitudin commodo", "question5": "varius et, euismod", "question6": "Aliquam tincidunt, nunc", "question7": "metus sit amet", "question8": "enim non nisi.", "question9": "sed dolor. Fusce mi", "question10": "dolor dolor, tempus non,", "question11": "ultrices. Vivamus rhoncus. Donec", "question12": "sem eget massa. Suspendisse", "question13": "Suspendisse", "question14": "Vivamus", "question15": "pede", "question16": "magna.", "question17": "vel", "question18": "odio tristique", "question19": "non, lobortis", "question20": "magna. Nam", "question21": "nunc. In", "question22": "ultricies ligula.", "question23": "litora torquent", "question24": "ac mattis", "question25": "lacus. Mauris", "question26": "molestie in,", "question27": "magnis dis", "question28": "leo. Vivamus", "question29": "nisl. Quisque", "question30": "elit, pellentesque"' union all select '"question1": "vitae, aliquet nec, imperdiet nec, leo. Morbi neque tellus, imperdiet non, vestibulum", "question2": "lectus rutrum urna, nec luctus felis", "company": "Iaculis Corporation", "email": "quis.lectus@euismodindolor.com", "question3": "sem molestie", "personalnumber": "1620090167599", "phone": "07 24 95 71 18", "fathername": "Kendall Knapp", "birthplace": "Saudi Arabia", "coordinates": "66.25902, 127.87132", "password": "HPE32LQV2SL", "question4": "imperdiet dictum", "question5": "tempus scelerisque, lorem", "question6": "Sed nunc est,", "question7": "eget metus. In", "question8": "ultrices. Vivamus rhoncus.", "question9": "mauris sapien, cursus in,", "question10": "Duis sit amet diam", "question11": "enim nisl elementum purus,", "question12": "vehicula. Pellentesque tincidunt tempus", "question13": "ipsum", "question14": "enim", "question15": "adipiscing,", "question16": "amet", "question17": "diam", "question18": "Quisque libero", "question19": "Donec elementum,", "question20": "vitae odio", "question21": "Pellentesque ut", "question22": "conubia nostra,", "question23": "egestas, urna", "question24": "Nunc sed", "question25": "Sed eget", "question26": "Integer vitae", "question27": "Ut tincidunt", "question28": "neque vitae", "question29": "enim commodo", "question30": "dictum. Phasellus"' union all select '"question1": "euismod est arcu", "question2": "at pretium aliquet, metus urna convallis erat, eget tincidunt dui augue eu tellus. Phasellus elit pede, malesuada vel,", "company": "Ultrices Incorporated", "email": "ullamcorper.Duis.cursus@ascelerisque.co.uk", "question3": "sit amet nulla.", "personalnumber": "1605012111199", "phone": "01 81 98 21 76", "fathername": "Ocean Reese", "birthplace": "Grenada", "coordinates": "-47.21548, -105.17022", "password": "ZJA67PTP1LY", "question4": "parturient", "question5": "egestas a, dui.", "question6": "molestie pharetra nibh.", "question7": "gravida sit amet,", "question8": "elit sed consequat", "question9": "Nunc sed orci lobortis", "question10": "Donec at arcu. Vestibulum", "question11": "Cum sociis natoque penatibus", "question12": "viverra. Maecenas iaculis aliquet", "question13": "consectetuer", "question14": "et,", "question15": "arcu", "question16": "consequat", "question17": "metus.", "question18": "eu augue", "question19": "elit. Etiam", "question20": "penatibus et", "question21": "dolor dolor,", "question22": "risus. Donec", "question23": "tellus eu", "question24": "diam luctus", "question25": "nibh. Donec", "question26": "Sed eu", "question27": "ut quam", "question28": "vulputate velit", "question29": "pharetra nibh.", "question30": "pede, malesuada"' union all select '"question1": "commodo auctor velit. Aliquam nisl. Nulla eu neque pellentesque massa lobortis ultrices. Vivamus rhoncus. Donec est. Nunc", "question2": "velit. Aliquam nisl. Nulla eu neque pellentesque massa lobortis ultrices. Vivamus rhoncus. Donec est. Nunc ullamcorper, velit in aliquet", "company": "Donec Tempus Limited", "email": "ornare.sagittis@blanditviverra.co.uk", "question3": "Vivamus molestie", "personalnumber": "1676110867699", "phone": "08 67 94 53 59", "fathername": "Kadeem Henson", "birthplace": "Mongolia", "coordinates": "-36.44706, 114.96676", "password": "RFK31QAK6DZ", "question4": "Quisque ac", "question5": "arcu. Aliquam ultrices", "question6": "odio. Nam interdum", "question7": "Proin velit. Sed", "question8": "aliquet, metus urna", "question9": "eleifend non, dapibus rutrum,", "question10": "ultrices. Vivamus rhoncus. Donec", "question11": "mollis lectus pede et", "question12": "gravida sagittis. Duis gravida.", "question13": "ullamcorper,", "question14": "odio.", "question15": "diam", "question16": "ullamcorper", "question17": "odio", "question18": "interdum. Nunc", "question19": "nunc ac", "question20": "orci. Phasellus", "question21": "rhoncus. Proin", "question22": "nibh sit", "question23": "tellus. Suspendisse", "question24": "et malesuada", "question25": "Sed eu", "question26": "Curabitur consequat,", "question27": "risus. Quisque", "question28": "Duis ac", "question29": "augue ac", "question30": "feugiat non,"' union all select '"question1": "mattis. Integer eu lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit fermentum risus, at fringilla purus mauris a nunc. In at pede. Cras vulputate", "question2": "tempor, est ac mattis semper, dui lectus", "company": "Eu Company", "email": "tincidunt@anteipsumprimis.com", "question3": "sit", "personalnumber": "1676052983799", "phone": "08 58 32 53 52", "fathername": "Chaney Cabrera", "birthplace": "Saint Barthélemy", "coordinates": "59.6485, 15.37343", "password": "AXI99HUZ4XX", "question4": "nec", "question5": "augue id ante", "question6": "scelerisque neque sed", "question7": "adipiscing non, luctus", "question8": "amet ultricies sem", "question9": "augue, eu tempor erat", "question10": "varius ultrices, mauris ipsum", "question11": "vitae, sodales at, velit.", "question12": "eu, eleifend nec, malesuada", "question13": "urna.", "question14": "neque", "question15": "ante,", "question16": "aliquet", "question17": "In", "question18": "eu augue", "question19": "ultrices, mauris", "question20": "nec, leo.", "question21": "tortor. Integer", "question22": "tellus. Aenean", "question23": "feugiat tellus", "question24": "eget metus.", "question25": "scelerisque dui.", "question26": "a, dui.", "question27": "diam eu", "question28": "sem, consequat", "question29": "egestas blandit.", "question30": "semper egestas,"' union all select '"question1": "non enim commodo hendrerit. Donec porttitor tellus non magna. Nam ligula elit, pretium et, rutrum non,", "question2": "velit in aliquet lobortis, nisi nibh lacinia orci, consectetuer euismod est arcu", "company": "Consectetuer Cursus Et Corporation", "email": "rutrum@odioauctorvitae.ca", "question3": "elementum sem, vitae", "personalnumber": "1615100271799", "phone": "06 56 26 36 78", "fathername": "Kimberly W. Myers", "birthplace": "Thailand", "coordinates": "57.26877, 91.26673", "password": "PZC85FWQ4OB", "question4": "nisi nibh lacinia", "question5": "a felis ullamcorper", "question6": "facilisi. Sed neque.", "question7": "ipsum sodales purus,", "question8": "Donec tincidunt. Donec", "question9": "et ipsum cursus vestibulum.", "question10": "elementum, lorem ut aliquam", "question11": "penatibus et magnis dis", "question12": "a purus. Duis elementum,", "question13": "nisl.", "question14": "diam", "question15": "bibendum", "question16": "ipsum.", "question17": "eu", "question18": "sem eget", "question19": "Cum sociis", "question20": "Cras pellentesque.", "question21": "non, vestibulum", "question22": "nunc id", "question23": "ut, pharetra", "question24": "adipiscing elit.", "question25": "nisi a", "question26": "elit erat", "question27": "sit amet", "question28": "ornare placerat,", "question29": "ac, fermentum", "question30": "adipiscing elit."' ) SELECT @fields =(select top 1 field from fields order by newid()); -- get a random datetime +/- 365 days DECLARE @date1 DATETIME; SET @date1 = GETDATE() + (365 * 10 * RAND() - 3650); DECLARE @json NVARCHAR(MAX) = N'{"firstname":"'+@firstname+ '","lastname":"'+CONVERT(varchar(255), NEWID())+ '","age":'+CONVERT(varchar(255), @age)+',"city":"'+@cityname+'","type":"A","expenditure":'+CONVERT(varchar(255),@expenditure)+ ',"salary":'+CONVERT(varchar(255),@salary)+',"taxes":'+CONVERT(varchar(255),@taxes)+ ','+@fields+'}'; INSERT INTO [dbo].[AssessmentResponses] ([AssessmentID] ,[Respondent] ,[Date] ,[JsonSchema]) VALUES (1 ,@respondent ,@date1 ,@json); SET @loopCount=@loopCount+1; END
50000 rows affected
 hidden batch(es)


SELECT COUNT(*) FROM AssessmentResponses
(No column name)
50000
 hidden batch(es)


set statistics xml on; DECLARE @dt1 DATETIME2(7) = SYSDATETIME(); SELECT [ResponseID] ,[AssessmentID] ,[Respondent] ,JSON_VALUE(t.JsonSchema, '$.salary') AS Salary ,[Date] ,[JsonSchema] FROM [AssessmentResponses] AS t WHERE JSON_VALUE(t.JsonSchema, '$.firstname') = N'Burt' AND JSON_VALUE(t.JsonSchema, '$.age') < 18 AND JSON_VALUE(t.JsonSchema, '$.age') >6 AND CAST(JSON_VALUE(t.JsonSchema, '$.expenditure') AS DECIMAL(18,2)) >45000.00 AND JSON_VALUE(t.JsonSchema, '$.city') >'Rome' ORDER BY CAST(JSON_VALUE(t.JsonSchema, '$.salary') AS DECIMAL(18,2)) DESC SELECT DATEDIFF(millisecond,@dt1,SYSDATETIME()) AS runtime_ms;
ResponseID AssessmentID Respondent Salary Date JsonSchema
26066 1 7 53869.04 01/02/2013 14:28:08 {"firstname":"Burt","lastname":"EEFB4C2F-1998-4C30-AADD-44DFAAABC1EE","age":12,"city":"San Salvador","type":"A","expenditure":45224.73,"salary":53869.04,"taxes":3479.79,"question1": "euismod est arcu", "question2": "at pretium aliquet, metus urna convallis erat, eget tincidunt dui augue eu tellus. Phasellus elit pede, malesuada vel,", "company": "Ultrices Incorporated", "email": "ullamcorper.Duis.cursus@ascelerisque.co.uk", "question3": "sit amet nulla.", "personalnumber": "1605012111199", "phone": "01 81 98 21 76", "fathername": "Ocean Reese", "birthplace": "Grenada", "coordinates": "-47.21548, -105.17022", "password": "ZJA67PTP1LY", "question4": "parturient", "question5": "egestas a, dui.", "question6": "molestie pharetra nibh.", "question7": "gravida sit amet,", "question8": "elit sed consequat", "question9": "Nunc sed orci lobortis", "question10": "Donec at arcu. Vestibulum", "question11": "Cum sociis natoque penatibus", "question12": "viverra. Maecenas iaculis aliquet", "question13": "consectetuer", "question14": "et,", "question15": "arcu", "question16": "consequat", "question17": "metus.", "question18": "eu augue", "question19": "elit. Etiam", "question20": "penatibus et", "question21": "dolor dolor,", "question22": "risus. Donec", "question23": "tellus eu", "question24": "diam luctus", "question25": "nibh. Donec", "question26": "Sed eu", "question27": "ut quam", "question28": "vulputate velit", "question29": "pharetra nibh.", "question30": "pede, malesuada"}
21417 1 4 34860.71 29/08/2012 08:12:38 {"firstname":"Burt","lastname":"A09BF2E2-48E3-441E-8A37-E3241E96F8C8","age":7,"city":"San Salvador","type":"A","expenditure":48391.40,"salary":34860.71,"taxes":5683.05,"question1": "vitae, aliquet nec, imperdiet nec, leo. Morbi neque tellus, imperdiet non, vestibulum", "question2": "lectus rutrum urna, nec luctus felis", "company": "Iaculis Corporation", "email": "quis.lectus@euismodindolor.com", "question3": "sem molestie", "personalnumber": "1620090167599", "phone": "07 24 95 71 18", "fathername": "Kendall Knapp", "birthplace": "Saudi Arabia", "coordinates": "66.25902, 127.87132", "password": "HPE32LQV2SL", "question4": "imperdiet dictum", "question5": "tempus scelerisque, lorem", "question6": "Sed nunc est,", "question7": "eget metus. In", "question8": "ultrices. Vivamus rhoncus.", "question9": "mauris sapien, cursus in,", "question10": "Duis sit amet diam", "question11": "enim nisl elementum purus,", "question12": "vehicula. Pellentesque tincidunt tempus", "question13": "ipsum", "question14": "enim", "question15": "adipiscing,", "question16": "amet", "question17": "diam", "question18": "Quisque libero", "question19": "Donec elementum,", "question20": "vitae odio", "question21": "Pellentesque ut", "question22": "conubia nostra,", "question23": "egestas, urna", "question24": "Nunc sed", "question25": "Sed eget", "question26": "Integer vitae", "question27": "Ut tincidunt", "question28": "neque vitae", "question29": "enim commodo", "question30": "dictum. Phasellus"}
16832 1 4 32156.71 04/05/2011 22:50:13 {"firstname":"Burt","lastname":"D27B2462-9244-4B78-9402-13DEA68EC393","age":14,"city":"Stone Town","type":"A","expenditure":46636.98,"salary":32156.71,"taxes":11642.80,"question1": "commodo auctor velit. Aliquam nisl. Nulla eu neque pellentesque massa lobortis ultrices. Vivamus rhoncus. Donec est. Nunc", "question2": "velit. Aliquam nisl. Nulla eu neque pellentesque massa lobortis ultrices. Vivamus rhoncus. Donec est. Nunc ullamcorper, velit in aliquet", "company": "Donec Tempus Limited", "email": "ornare.sagittis@blanditviverra.co.uk", "question3": "Vivamus molestie", "personalnumber": "1676110867699", "phone": "08 67 94 53 59", "fathername": "Kadeem Henson", "birthplace": "Mongolia", "coordinates": "-36.44706, 114.96676", "password": "RFK31QAK6DZ", "question4": "Quisque ac", "question5": "arcu. Aliquam ultrices", "question6": "odio. Nam interdum", "question7": "Proin velit. Sed", "question8": "aliquet, metus urna", "question9": "eleifend non, dapibus rutrum,", "question10": "ultrices. Vivamus rhoncus. Donec", "question11": "mollis lectus pede et", "question12": "gravida sagittis. Duis gravida.", "question13": "ullamcorper,", "question14": "odio.", "question15": "diam", "question16": "ullamcorper", "question17": "odio", "question18": "interdum. Nunc", "question19": "nunc ac", "question20": "orci. Phasellus", "question21": "rhoncus. Proin", "question22": "nibh sit", "question23": "tellus. Suspendisse", "question24": "et malesuada", "question25": "Sed eu", "question26": "Curabitur consequat,", "question27": "risus. Quisque", "question28": "Duis ac", "question29": "augue ac", "question30": "feugiat non,"}
29754 1 5 9592.32 27/05/2009 06:17:41 {"firstname":"Burt","lastname":"58145390-D305-48A3-A09C-6D0170DA79BB","age":17,"city":"San Salvador","type":"A","expenditure":48181.66,"salary":9592.32,"taxes":4755.03,"question1": "id sapien. Cras dolor dolor, tempus non, lacinia at, iaculis quis,", "question2": "ipsum. Curabitur consequat, lectus sit amet luctus vulputate, nisi sem semper", "company": "Pellentesque Habitant LLP", "email": "Fusce.aliquet.magna@diameudolor.net", "question3": "sit", "personalnumber": "1619051430999", "phone": "05 41 58 43 96", "fathername": "Guinevere I. Dyer", "birthplace": "Barbados", "coordinates": "37.93981, -51.22476", "password": "MHY59WAC1BW", "question4": "Phasellus libero", "question5": "dui, nec tempus", "question6": "augue porttitor interdum.", "question7": "molestie. Sed id", "question8": "enim diam vel", "question9": "sed sem egestas blandit.", "question10": "eros nec tellus. Nunc", "question11": "rutrum non, hendrerit id,", "question12": "odio a purus. Duis", "question13": "dui.", "question14": "est", "question15": "ac", "question16": "vitae", "question17": "Curabitur", "question18": "accumsan sed,", "question19": "Sed pharetra,", "question20": "dapibus id,", "question21": "sem, vitae", "question22": "et libero.", "question23": "Cras sed", "question24": "adipiscing ligula.", "question25": "Sed molestie.", "question26": "Vestibulum ante", "question27": "parturient montes,", "question28": "Cras eu", "question29": "Aliquam rutrum", "question30": "quam quis"}
27762 1 3 1909.59 06/03/2014 10:48:07 {"firstname":"Burt","lastname":"1DC4845A-F1E7-4BC4-809D-FA91D070F7DD","age":7,"city":"Stone Town","type":"A","expenditure":45282.10,"salary":1909.59,"taxes":16213.05,"question1": "mattis. Integer eu lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit fermentum risus, at fringilla purus mauris a nunc. In at pede. Cras vulputate", "question2": "tempor, est ac mattis semper, dui lectus", "company": "Eu Company", "email": "tincidunt@anteipsumprimis.com", "question3": "sit", "personalnumber": "1676052983799", "phone": "08 58 32 53 52", "fathername": "Chaney Cabrera", "birthplace": "Saint Barthélemy", "coordinates": "59.6485, 15.37343", "password": "AXI99HUZ4XX", "question4": "nec", "question5": "augue id ante", "question6": "scelerisque neque sed", "question7": "adipiscing non, luctus", "question8": "amet ultricies sem", "question9": "augue, eu tempor erat", "question10": "varius ultrices, mauris ipsum", "question11": "vitae, sodales at, velit.", "question12": "eu, eleifend nec, malesuada", "question13": "urna.", "question14": "neque", "question15": "ante,", "question16": "aliquet", "question17": "In", "question18": "eu augue", "question19": "ultrices, mauris", "question20": "nec, leo.", "question21": "tortor. Integer", "question22": "tellus. Aenean", "question23": "feugiat tellus", "question24": "eget metus.", "question25": "scelerisque dui.", "question26": "a, dui.", "question27": "diam eu", "question28": "sem, consequat", "question29": "egestas blandit.", "question30": "semper egestas,"}
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.481" Build="14.0.3045.24"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT [ResponseID]&#xa; ,[AssessmentID]&#xa; ,[Respondent]&#xa;&#x9; ,JSON_VALUE(t.JsonSchema, &apos;$.salary&apos;) AS Salary&#xa; ,[Date]&#xa; ,[JsonSchema]&#xa; FROM [AssessmentResponses] AS t&#xa; WHERE JSON_VALUE(t.JsonSchema, &apos;$.firstname&apos;) = N&apos;Burt&apos; &#xa; AND JSON_VALUE(t.JsonSchema, &apos;$.age&apos;) &lt; 18 &#xa; AND JSON_VALUE(t.JsonSchema, &apos;$.age&apos;) &gt;6 &#xa; AND CAST(JSON_VALUE(t.JsonSchema, &apos;$.expenditure&apos;) AS DECIMAL(18,2)) &gt;45000.00&#xa; AND JSON_VALUE(t.JsonSchema, &apos;$.city&apos;) &gt;&apos;Rome&apos;&#xa; ORDER BY CAST(JSON_VALUE(t.JsonSchema, &apos;$.salary&apos;) AS DECIMAL(18,2)) DESC" StatementId="1" StatementCompId="3" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="18.6814" StatementEstRows="1" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x7DFA6DA040114A05" QueryPlanHash="0x0EB90FE490A1D59D" CardinalityEstimationModelVersion="140"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"></StatementSetOptions><QueryPlan DegreeOfParallelism="0" MemoryGrant="1024" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="32" CompileTime="78" CompileCPU="78" CompileMemory="392"><Warnings><MemoryGrantWarning GrantWarningKind="Excessive Grant" RequestedMemory="1024" GrantedMemory="1024" MaxUsedMemory="32"></MemoryGrantWarning></Warnings><MemoryGrantInfo SerialRequiredMemory="512" SerialDesiredMemory="544" RequiredMemory="512" DesiredMemory="544" RequestedMemory="1024" GrantWaitTime="0" GrantedMemory="1024" MaxUsedMemory="32" MaxQueryMemory="580896"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="419378" EstimatedPagesCached="26211" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="809672"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2019-02-07T17:30:31.06" ModificationCount="0" SamplingPercent="15.696" Statistics="[_WA_Sys_00000005_34C8D9D1]" Table="[AssessmentResponses]" Schema="[dbo]" Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]"></StatisticsInfo></OptimizerStatsUsage><TraceFlags IsCompileTime="1"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="156" CpuTime="156"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.000107398" AvgRowSize="7398" EstimatedTotalSubtreeCost="18.6814" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="ResponseID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="AssessmentID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Respondent"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference></OutputList><MemoryFractions Input="1" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="5" Batches="0" ActualExecutionMode="Row" ActualElapsedms="156" ActualCPUms="156" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1024" OutputMemoryGrant="640" UsedMemoryGrant="32"></RunTimeCountersPerThread></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="0"><ColumnReference Column="Expr1002"></ColumnReference></OrderByColumn></OrderBy><RelOp NodeId="1" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="1" EstimateIO="0" EstimateCPU="0.089" AvgRowSize="7398" EstimatedTotalSubtreeCost="18.6701" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="ResponseID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="AssessmentID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Respondent"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="5" Batches="0" ActualExecutionMode="Row" ActualElapsedms="156" ActualCPUms="156" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Filter StartupExpression="0"><RelOp NodeId="2" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="50000" EstimateIO="0" EstimateCPU="0.005" AvgRowSize="15416" EstimatedTotalSubtreeCost="18.5811" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="ResponseID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="AssessmentID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Respondent"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference><ColumnReference Column="Expr1003"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference><ColumnReference Column="Expr1006"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1001"></ColumnReference><ScalarOperator ScalarString="json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.salary&apos;)"><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.salary&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1002"></ColumnReference><ScalarOperator ScalarString="CONVERT(decimal(18,2),json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.salary&apos;),0)"><Convert DataType="decimal" Precision="18" Scale="2" Style="0" Implicit="0"><ScalarOperator><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.salary&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1003"></ColumnReference><ScalarOperator ScalarString="json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.firstname&apos;)"><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.firstname&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1004"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.age&apos;),0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.age&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="CONVERT(decimal(18,2),json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.expenditure&apos;),0)"><Convert DataType="decimal" Precision="18" Scale="2" Style="0" Implicit="0"><ScalarOperator><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.expenditure&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1006"></ColumnReference><ScalarOperator ScalarString="json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.city&apos;)"><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.city&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="3" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="50000" EstimatedRowsRead="50000" EstimateIO="18.5209" EstimateCPU="0.055157" AvgRowSize="3387" EstimatedTotalSubtreeCost="18.5761" TableCardinality="50000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="ResponseID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="AssessmentID"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Respondent"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Date"></ColumnReference><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="50000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="31" ActualCPUms="31" ActualScans="1" ActualLogicalReads="25094" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="50000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="ResponseID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="AssessmentID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Respondent"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="Date"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Index="[PK_AssessmentResponses]" Alias="[t]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></ComputeScalar></RelOp><Predicate><ScalarOperator ScalarString="[Expr1003]=N&apos;Burt&apos; AND [Expr1004]&lt;(18) AND [Expr1004]&gt;(6) AND [Expr1005]&gt;(45000.00) AND [Expr1006]&gt;N&apos;Rome&apos;"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1003"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;Burt&apos;"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="LT"><ScalarOperator><Identifier><ColumnReference Column="Expr1004"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(18)"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="GT"><ScalarOperator><Identifier><ColumnReference Column="Expr1004"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(6)"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="GT"><ScalarOperator><Identifier><ColumnReference Column="Expr1005"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(45000.00)"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="GT"><ScalarOperator><Identifier><ColumnReference Column="Expr1006"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;Rome&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Predicate></Filter></RelOp></Sort></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
runtime_ms
156
 hidden batch(es)


set statistics xml on; DECLARE @dt1 DATETIME2(7) = SYSDATETIME(); SELECT count(*) AS ItemCount, AVG(CAST(JSON_VALUE(t.JsonSchema, '$.salary') AS DECIMAL(18,2))) AS SalaryAvg, JSON_VALUE(t.JsonSchema, '$.city') AS City FROM [AssessmentResponses] AS t WHERE JSON_VALUE(t.JsonSchema, '$.firstname') = N'Valerio' AND JSON_VALUE(t.JsonSchema, '$.age') < 18 AND JSON_VALUE(t.JsonSchema, '$.age') >6 AND CAST(JSON_VALUE(t.JsonSchema, '$.expenditure') AS DECIMAL(18,2)) >35000.00 GROUP BY JSON_VALUE(t.JsonSchema, '$.city') SELECT DATEDIFF(millisecond,@dt1,SYSDATETIME()) AS runtime_ms;
ItemCount SalaryAvg City
15 30151.098000 Dakar
13 17987.506153 Lima
17 24921.315294 Milano
23 26514.829565 Mombasa
9 37411.455555 Nairobi
21 22377.868571 New York
13 21954.053846 Panama
15 24080.367333 Roma
12 22262.263333 San Salvador
10 20085.871000 Stone Town
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.481" Build="14.0.3045.24"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT count(*) AS ItemCount,&#xa;AVG(CAST(JSON_VALUE(t.JsonSchema, &apos;$.salary&apos;) AS DECIMAL(18,2))) AS SalaryAvg,&#xa;JSON_VALUE(t.JsonSchema, &apos;$.city&apos;) AS City&#xa; FROM [AssessmentResponses] AS t&#xa; WHERE JSON_VALUE(t.JsonSchema, &apos;$.firstname&apos;) = N&apos;Valerio&apos; &#xa; AND JSON_VALUE(t.JsonSchema, &apos;$.age&apos;) &lt; 18 &#xa; AND JSON_VALUE(t.JsonSchema, &apos;$.age&apos;) &gt;6 &#xa; AND CAST(JSON_VALUE(t.JsonSchema, &apos;$.expenditure&apos;) AS DECIMAL(18,2)) &gt;35000.00&#xa;GROUP BY JSON_VALUE(t.JsonSchema, &apos;$.city&apos;)" StatementId="1" StatementCompId="3" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="18.6664" StatementEstRows="1" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x2355E79C0F6F55B7" QueryPlanHash="0x29D905F43BE3AD40" CardinalityEstimationModelVersion="140"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"></StatementSetOptions><QueryPlan DegreeOfParallelism="0" MemoryGrant="1024" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="40" CompileTime="0" CompileCPU="0" CompileMemory="448"><Warnings><MemoryGrantWarning GrantWarningKind="Excessive Grant" RequestedMemory="1024" GrantedMemory="1024" MaxUsedMemory="16"></MemoryGrantWarning></Warnings><MemoryGrantInfo SerialRequiredMemory="512" SerialDesiredMemory="544" RequiredMemory="512" DesiredMemory="544" RequestedMemory="1024" GrantWaitTime="0" GrantedMemory="1024" MaxUsedMemory="16" MaxQueryMemory="580896"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="419378" EstimatedPagesCached="26211" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="804616"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2019-02-07T17:30:31.06" ModificationCount="0" SamplingPercent="15.696" Statistics="[_WA_Sys_00000005_34C8D9D1]" Table="[AssessmentResponses]" Schema="[dbo]" Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]"></StatisticsInfo></OptimizerStatsUsage><TraceFlags IsCompileTime="1"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><WaitStats><Wait WaitType="MEMORY_ALLOCATION_EXT" WaitTimeMs="15" WaitCount="55833"></Wait></WaitStats><QueryTimeStats ElapsedTime="156" CpuTime="156"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="4032" EstimatedTotalSubtreeCost="18.6664" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference><ColumnReference Column="Expr1003"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1002"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1014],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1014"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1003"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1015]=(0) THEN NULL ELSE [Expr1016]/CONVERT_IMPLICIT(decimal(19,0),[Expr1015],0) END"><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1015"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Then><Else><ScalarOperator><Arithmetic Operation="DIV"><ScalarOperator><Identifier><ColumnReference Column="Expr1016"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Convert DataType="decimal" Precision="19" Scale="0" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1015"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></Arithmetic></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="1.1e-006" AvgRowSize="4032" EstimatedTotalSubtreeCost="18.6664" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1014"></ColumnReference><ColumnReference Column="Expr1015"></ColumnReference><ColumnReference Column="Expr1016"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="10" Batches="0" ActualExecutionMode="Row" ActualElapsedms="156" ActualCPUms="156" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1014"></ColumnReference><ScalarOperator ScalarString="Count(*)"><Aggregate AggType="countstar" Distinct="0"></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1015"></ColumnReference><ScalarOperator ScalarString="COUNT_BIG([Expr1004])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Column="Expr1004"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1016"></ColumnReference><ScalarOperator ScalarString="SUM([Expr1004])"><Aggregate Distinct="0" AggType="SUM"><ScalarOperator><Identifier><ColumnReference Column="Expr1004"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Column="Expr1001"></ColumnReference></GroupBy><RelOp NodeId="2" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.00010402" AvgRowSize="4020" EstimatedTotalSubtreeCost="18.6664" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><MemoryFractions Input="1" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="148" Batches="0" ActualExecutionMode="Row" ActualElapsedms="156" ActualCPUms="156" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1024" OutputMemoryGrant="640" UsedMemoryGrant="16"></RunTimeCountersPerThread></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Column="Expr1001"></ColumnReference></OrderByColumn></OrderBy><RelOp NodeId="3" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="1" EstimateIO="0" EstimateCPU="0.074" AvgRowSize="4020" EstimatedTotalSubtreeCost="18.6551" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="148" Batches="0" ActualExecutionMode="Row" ActualElapsedms="156" ActualCPUms="156" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Filter StartupExpression="0"><RelOp NodeId="4" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="50000" EstimateIO="0" EstimateCPU="0.005" AvgRowSize="8035" EstimatedTotalSubtreeCost="18.5811" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1001"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference><ColumnReference Column="Expr1006"></ColumnReference><ColumnReference Column="Expr1007"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1001"></ColumnReference><ScalarOperator ScalarString="json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.city&apos;)"><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.city&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1004"></ColumnReference><ScalarOperator ScalarString="CONVERT(decimal(18,2),json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.salary&apos;),0)"><Convert DataType="decimal" Precision="18" Scale="2" Style="0" Implicit="0"><ScalarOperator><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.salary&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.firstname&apos;)"><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.firstname&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1006"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.age&apos;),0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.age&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1007"></ColumnReference><ScalarOperator ScalarString="CONVERT(decimal(18,2),json_value([fiddle_feae23c8d5214acfac065bc69cf39ded].[dbo].[AssessmentResponses].[JsonSchema] as [t].[JsonSchema],N&apos;$.expenditure&apos;),0)"><Convert DataType="decimal" Precision="18" Scale="2" Style="0" Implicit="0"><ScalarOperator><Intrinsic FunctionName="json_value"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;$.expenditure&apos;"></Const></ScalarOperator></Intrinsic></ScalarOperator></Convert></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="5" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="50000" EstimatedRowsRead="50000" EstimateIO="18.5209" EstimateCPU="0.055157" AvgRowSize="3319" EstimatedTotalSubtreeCost="18.5761" TableCardinality="50000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="50000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="46" ActualCPUms="46" ActualScans="1" ActualLogicalReads="25094" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="50000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Alias="[t]" Column="JsonSchema"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_feae23c8d5214acfac065bc69cf39ded]" Schema="[dbo]" Table="[AssessmentResponses]" Index="[PK_AssessmentResponses]" Alias="[t]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></ComputeScalar></RelOp><Predicate><ScalarOperator ScalarString="[Expr1005]=N&apos;Valerio&apos; AND [Expr1006]&lt;(18) AND [Expr1006]&gt;(6) AND [Expr1007]&gt;(35000.00)"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1005"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N&apos;Valerio&apos;"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="LT"><ScalarOperator><Identifier><ColumnReference Column="Expr1006"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(18)"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="GT"><ScalarOperator><Identifier><ColumnReference Column="Expr1006"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(6)"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="GT"><ScalarOperator><Identifier><ColumnReference Column="Expr1007"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(35000.00)"></Const></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Predicate></Filter></RelOp></Sort></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
runtime_ms
156
 hidden batch(es)