Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

JSON Has a Cost

JSON seems to be everywhere these days. Many application developers like it across all sorts of languages, C#, JAVA, Python, and more. They use it for transferring information between systems, and are comfortable serializing hierarchical object data into JSON from text and de-serializing it back into its various elements.

For those of us working in relational databases, JSON seems like a blob of information that isn't easily queried, indexed, or stored. We prefer working with a relational set of data, which brings us into conflict with software developers. We'd like them to convert their objects to a relational structure, and they'd like us to just work with JSON.

SQL Server has added new JSON functions in SQL Server 2025, expanding the JSON capabilities from previous versions. PostgreSQL has JSON types for a few versions, as has Oracle. Lots of applications are storing JSON data in databases. Unlike XML, however, JSON seems to be working well (overall) as a data storage mechanism.

Or is it?

At a recent conference, one of the speakers noted that we do a lot of data movement these days, and there can be a high cost to this as we pay for both compute and network. This data movement often incurs a query cost to get information from the source system. JSON can exacerbate this issue as we may send more data than necessary, and we might find our compute engines don't support predicate pushdown. Even if we index the JSON, we might still end up querying more data from disks to get what we need. Especially as we move a lot of data to warehouses and lakehouses.

Using JSON can slow things down. It's nice for storing a bunch of information quickly and easily, but as we need to work with specific parts of a JSON document, we would likely be better off de-serializing the important pieces into more structured formats that prevent duplication, are easily indexed, and can achieve quick query performance. Everything becomes a little smoother.

JSON is great, and I do like it, but it's not a substitute for relational systems and relational models.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
SQLServerCentral Article

Faster Data Engineering with Python Notebooks: The Fabric Modern Data Platform

John Miner from SQLServerCentral

In this next article on the Fabric Modern Data Platform, we use the Polars library in Python to improve our data engineering.

External Article

Power BI – Download, Install and Create Your First Report

Additional Articles from MSSQLTips.com

Power BI Desktop is Microsoft’s platform for analytics and visualization. The product has been around for over ten years, making it a mature feature-rich choice for business intelligence reporting and actionable insights. How do you get started downloading, installing, and configuring Power BI desktop?

Blog Post

From the SQL Server Central Blogs - SQL Server 2025 Developer Edition – One size fits all

John Morehouse from John Morehouse | Sqlrus.com

Microsoft has released SQL Server 2025, bringing big improvements to its main database engine. This version focuses on AI features and better performance, aiming to meet the needs of...

Blog Post

From the SQL Server Central Blogs - Act on Your Certification Test Results

K. Brian Kelley from Databases – Infrastructure – Security

Pass or fail, act on your certification test results.

Refactoring Databases cover

Refactoring Databases: Evolutionary Database Design

Site Owners from SQLServerCentral

Refactoring has proven its value in a wide range of development projects–helping software professionals improve system designs, maintainability, extensibility, and performance.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Which Result II

I have this code in SQL Server 2022:
CREATE SCHEMA etl;
GO
CREATE TABLE etl.product
(
    ProductID INT,
    ProductName VARCHAR(100)
);
GO
INSERT etl.product
VALUES
(2, 'Bee AI Wearable');
GO
CREATE TABLE dbo.product
(
    ProductID INT,
    ProductName VARCHAR(100)
);
GO
INSERT dbo.product
VALUES
(1, 'Spiral College-ruled Notebook');
GO
CREATE OR ALTER PROCEDURE etl.GettheProduct
AS
BEGIN
    exec('SELECT ProductName FROM product;')
END;
GO
When I execute this code as a user whose default schema is dbo and has rights to the tables and proc, what is returned?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Encoding URLs

I have this data in a table:

CREATE TABLE Response
( ResponseID INT NOT NULL CONSTRAINT ResponsePK PRIMARY KEY
, ResponseVal VARBINARY(5000)
)
GO

If I want to get a value from this table that I can add to a URL in a browser, which of these code items produces a result I can use?

Answer: SELECT BASE64_ENCODE(responseval,1) FROM dbo.Response WHERE ResponseID = 1

Explanation: The correct answer is to use BASE64_ENCODE(,1). The second parameter specifies if a URL safe value is needed, Ref: BASE64_ENCODE() - https://learn.microsoft.com/en-us/sql/t-sql/functions/base64-encode-transact-sql?view=fabric-sqldb&viewFallbackFrom=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2019 - Administration
Database file shrink issue. - Hi experts, I have a 3+ TB database on a 2019 sql server which has more than 50% free space. I know database or data file shrink is not a good practice so please not go there, I tried with 100 mb in a loop which is taking much longer time so it's not feasible. […]
Anything that is NOT about SQL!
Fantasy Football 2026 - The thread for the league in 2026. Players from last year have priority.
Editorials
Where Your Value Separates You from Others - Comments posted to this topic are about the item Where Your Value Separates You from Others
Your AI Successes - Comments posted to this topic are about the item Your AI Successes
Minimally Viable Security - Comments posted to this topic are about the item Minimally Viable Security
Article Discussions by Author
Fixing the Error - Comments posted to this topic are about the item Fixing the Error
T-SQL in SQL Server 2025: Encoding Functions - Comments posted to this topic are about the item T-SQL in SQL Server 2025: Encoding Functions
Which Table I - Comments posted to this topic are about the item Which Table I
Using Python notebooks to save money in Fabric: The Fabric Modern Data Platform - Comments posted to this topic are about the item Using Python notebooks to save money in Fabric: The Fabric Modern Data Platform
Encoding NULL - Comments posted to this topic are about the item Encoding NULL
Loading a Database for USD$5 - Comments posted to this topic are about the item Loading a Database for USD$5
SQL Server 2022 - Administration
Certificates expired - Can't restore after creating new certificate - The previous DBA created a certificate which expired 12/31/2025. I came in hoping to have an easy day for New Year's Eve and found all of the backups were failing.  After doing the research, I found the certificate had expired. 1.  I created a new certificate since I couldn't update the expiry date. 2.  I […]
SQL Server 2022 - Development
advice on diving into devops for managing BI projects - hi , i know this is a sql server forum but i think my brain is aligned more with members of this forum than any other. we have a large netsuite migration in which multiple erps are involved.   The technologies on which those erp's run vary from db2 to all flavors of sql server based […]
Simplifying WHERE Condition with LIKE test on multiple columns - Good Evening, Is there a simpler way to rearrange the following WHERE condition: [Column_1] LIKE 'Beta08%' OR [Column_1] LIKE 'Beta11%' OR [Column_1] LIKE 'Beta16%' OR [Column_1] LIKE 'Beta17%' OR [Column_1] LIKE 'Beta15%' OR [Column_1] IN ('Beta192') OR [Column_2] LIKE 'Beta08%' OR [Column_2] LIKE 'Beta11%' OR [Column_2] LIKE 'Beta16%' OR [Column_2] LIKE 'Beta17%' OR [Column_2] LIKE […]
Switch partition: NULL boundary id - I have table: t1 in schema1 with 19 billion records. I have another table with same name: t1 in schema2. My goal is to move data from schema1 to schema2 and leave the empty table in schema 1. To achieve this, I'm using switch partitions. There are 30 boundary ids for the table schema1.t1 but […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -