如何加快对链接文档索引的查询
How to speed up query against index of linked document
我有以下数据库结构:
create class User
create class Social
create property Social.vk string
create property User.social LINK Social
create index User.social unique
create index Social.vk notunique
查询 select from User where social.vk = '123'
使用索引。
工作室的解释给我信息:
involvedIndexes
["User.social","Social.vk"]
elapsed
2771.4197
它明显比
慢
select from Social where vk = '123'
以 10-30 毫秒运行。
我怎样才能加快慢速查询或使用双向链接重新设计我的数据?
upd
与没有索引的查询时间相比,似乎没有使用索引,但根据 'explain' 它使用了。
upd2
当 'vk' 字段不唯一且具有许多重复值时出现问题
这是 bug 与 osql 的结合。简单的解决方法——直接查询索引。所以性能上没有问题。
我有以下数据库结构:
create class User
create class Social
create property Social.vk string
create property User.social LINK Social
create index User.social unique
create index Social.vk notunique
查询 select from User where social.vk = '123'
使用索引。
工作室的解释给我信息:
involvedIndexes
["User.social","Social.vk"]
elapsed
2771.4197
它明显比
慢select from Social where vk = '123'
以 10-30 毫秒运行。
我怎样才能加快慢速查询或使用双向链接重新设计我的数据?
upd
与没有索引的查询时间相比,似乎没有使用索引,但根据 'explain' 它使用了。
upd2
当 'vk' 字段不唯一且具有许多重复值时出现问题
这是 bug 与 osql 的结合。简单的解决方法——直接查询索引。所以性能上没有问题。