Performance considerations

One of the main concerns about JSON in SQL Server 2016 is performance. As mentioned, unlike XML, JSON is not fully supported; there is no JSON data type. Data in XML columns is stored as binary large objects (BLOBs). SQL Server supports two types of XML indexes that avoid parsing all the data at runtime to evaluate a query and allow efficient query processing. Without an index, these BLOBs are shredded at runtime to evaluate a query. As mentioned several times, there is no JSON data type; JSON is stored as simple Unicode text and the text has to be interpreted at runtime to evaluate a JSON query. This can lead to slow reading and writing performance for large JSON documents. The primary XML index indexes all tags, values, and paths within the XML instances in an XML column. The primary XML index is a shredded and persisted representation of the XML BLOBs in the XML data type column. For each XML BLOB in the column, the index creates several rows of data. The number of rows in the index is approximately equal to the number of nodes in the XML BLOB.

Since JSON is stored as text, it will always be interpreted. On JSON columns that are not larger than 1,700 bytes, you could create a non-clustered index, or use them as an included column without the limit.

Without a dedicated data type and storage, performance and options for JSON query improvements in SQL Server 2016 are limited: you can use computed columns and create indexes on them, or use the benefits of full-text indexes. However, you can expect performance problems during the processing of large amounts of JSON data in SQL Server 2016.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.14.245