Oracle Soda 搜索 json 文档的速度和资源差异

问题描述 投票:0回答:1
如果我有 500 000 条记录,并且需要使用 soda 和 REST 在 json 文档中搜索特定的playerId,那么 json 文档的复杂程度在性能和资源使用方面是否存在差异? ...设计时我应该考虑什么?

这里有两个 json 文档示例,我想比较它们来搜索playerId。如果我使用#1,我不需要创建#2,但我担心性能和资源使用。我目前在 Always Free ORDS 上进行测试。

#1:

{ "totClicks": 12, "playerCreationDate": "2024-06-22 10:23:40", "playerId": "bIEkjklaiUxxxxkHNX6Uq6g86J4N", "isSignedIn": true, "nrOfMultiplayerMatches": 0, "nrNotCompletedMultiplayerMatches": 0, "totSwappedTriplets": 0, "totMultiMatchTimeSec": 0, "totSwappedQuadruplets": 0, "playerNameHash": "Maria K#2631", "nrNotCompletedSingleplayerMatches": 0, "singleMatchesScore": 0, "lastLogin": "2024-06-22 10:23:40", "speedPlayerLvl": 0, "scoreSpeedSinglePlayerMatch": 0, "nrOfSpeedSinglePlayerMatches": 0, "isLinked": true, "singleMatchStats_List": [ "(0)S_0(1)bIEkjklaiUxxxxkHNX6Uq6g86J4N(2)0(3)0(4)0(5)0(6)8(7)6/22/2024 10:24:37 AM(8)60(9)34.35301(10)True(11)False(12)False(13)True(14)12(15)4(16)0(17)0(18)False(19)0(20)0" ], "dbJsonId": "D10F90144EE54864AABEBC1F6E0FA3D8", "totSingleMatchTime": "00:00:34.3530000", "isOpenForAnonymousMatches": false, "playerLvl": 0, "nrEvenMultiplayerMatches": 0, "isUpdated2Db": true, "nrLostMultiplayerMatches": 0, "playerName": "Maria K", "hasDoneTutorial": true, "playerNameFacebook": null, "isOfflineLogin": false, "nrWonMultiplayerMatches": 0, "nrOfLogins": 2, "isAnonymousLogin": false, "nrOfflineLogins": 0, "multiplayerMatchStats_List": null, "totSwappedPairs": 4, "nrOfSingleMatches": 1, "isFacebookLogin": false, "isUnityLogin": true }
#2:

{ "playerId": "bIEQZDEqKb6fDs7HNX6Uq6g86J4N", "playerName": "Mexitegel", "startTime": "2024-07-03T10:22:32.5349026Z" }
    
json oracle soda
1个回答
0
投票
您的 SODA 或 JSON 请求应被视为 SQL 语句 - 频繁使用的属性(例如表列)可能应该建立索引。

您可以使用 SQL 工具来收集执行计划,以查看返回 JSON 对象和文档所涉及的总成本和计划步骤。

添加一个想法可以减少逻辑阅读之类的事情。

enter image description here

场景和示例 ddl 在这里

https://www.thatjeffsmith.com/archive/2021/07/json-creating-indexes-in-database-actions/

© www.soinside.com 2019 - 2024. All rights reserved.