admin管理员组文章数量:1336576
So, we have a SQL table named Clients which has the following columns:
- UniqueId (nvarchar(200), not null)
- Data (nvarchar(max), null) - this one has JSON for each row(aprox. 30k-40k characters)
And we got a request to return to our user, UniqueId using the value from one of the parameters nested in Data JSON field (let's call it Value in this example)
We got something like this:
select UniqueId
from dbo.Clients
where JSON_VALUE(Data,'$.Parent.Child.ChildOfChild.Value') like 'Value'
But, as expected, table which has 20k+ rows and each row contains JSON in Data(with 30k-40k characters) takes a very long time to execute.
Our question is, is there any way to speed up this kind of query? Given the fact that we can't change the table design. Thanks in advance!
本文标签: jsonSQLHow to speed up a query execution while using JSONValue in WHERE clauseStack Overflow
版权声明:本文标题:json - SQL - How to speed up a query execution while using JSON_Value in WHERE clause - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742364707a2461054.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论