agens-graph - 如何在 AgensGraph 上更快地获取标签的最大位置 ID?
问题描述
我想获得标签的最大位置 ID。
但是,跟踪查询非常慢。
agens=# match (n:v) return max(graphid_locid(id(n)));
max
-----
6
(1 row)
如何在 AgensGraph 上更快地获取标签的最大位置 ID?
解决方案
从 pg_sequences 表中获取相关的序列值。
agens=# select start_value from pg_sequences where schemaname = 'graph' and sequencename = 'v_id_seq';
start_value
-------------
6
(1 row)
推荐阅读
- bash - grep 多个文件中的多个字符串,并在找到第一个匹配项时停止处理其他文件
- c# - 嵌套的 if 条件与多个单独的 if 条件,每个条件都有 return 语句
- mysql - 您如何记录使用 SQL 访问数据库的程序?
- gcc - 实在看不懂gcc怎么初始化数组
- c# - 文件打开 dotnet core 2.1 System.IO.IOException
- android - 我越来越未定义不是一个对象(评估'this.props.navigation.navigate')
- python - inspect.signature 究竟如何与类一起工作?
- pentaho - 我可以从 pentaho 中的 URL 获取参数吗?
- c# - .NET Console.Readline 不读取输入的第一行
- c# - 想要C#中POCO和DTO的区别