我的文档结构如下:
{
map: 'A',
points: [
{
type: 'type1',
distanceToSpawn: 110
},
{
type: 'type4',
distanceToSpawn: 40
},
{
type: 'type6',
distanceToSpawn: 30
}
]
},
{
map: 'B',
points: [
{
type: 'type1',
distanceToSpawn: 100
},
{
type: 'type2',
distanceToSpawn: 60
},
{
type: 'type3',
distanceToSpawn: 25
}
]
},
{
map: 'C',
points: [
{
type: 'type2',
distanceToSpawn: 90
},
{
type: 'type3',
distanceToSpawn: 1
},
{
type: 'type6',
distanceToSpawn: 76
}
]
}
Run Code Online (Sandbox Code Playgroud)
我希望得到所有具有type1按distanceToSpawn …
我有一个 oracle 11g docker 容器(使用这个 docker 镜像)。
当我尝试执行时SELECT COUNT(*) FROM ALL_OBJECTS,返回 7000 大约需要 100 秒。
在其他数据库(硬安装)上,相同的查询在 2 秒内返回 62000
为什么这个查询在 docker 上太长?
谢谢。
在一个应用程序中,我正在使用SharedPrefernces保存/加载(序列化/反序列化)某些对象。
这是反序列化代码:
private void loadData() {
String str = sharedPreferences.getString(PREF_TAG, null);
byte[] bytes = Base64.decode(str, Base64.DEFAULT);
try {
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream input = new ObjectInputStream(bais);
arrayOfObjects = (ArrayList<MyObject>) input.readObject();
} catch (Exception e) {
Log.i("BUG", "error decoding serialized objects: " + e.toString());
}
if (arrayOfObjects == null) {
Log.i("BUG", "serious problem!");
}
}
Run Code Online (Sandbox Code Playgroud)
但是每当我编译该项目时,该行:
arrayOfObjects = (ArrayList<MyObject>) input.readObject();
Run Code Online (Sandbox Code Playgroud)
引起警告,包含此方法的类“使用未经检查或不安全的操作”。
如何摆脱此警告或更改代码以更安全?