kdb:有没有办法有效地合并两个排序表?

发布于 2025-01-11 16:09:29 字数 256 浏览 1 评论 0原文

假设我们有两个表都在 time 列上排序:

t1:`time xasc ([]time:5?100;v:5?1000)
t2:`time xasc ([]time:5?100;v:5?1000)

是否有一种有效的方法来获得与 `time xasc t1,t2 相同的结果,利用这两个表表格已经排序了吗?我查看了aj,但我无法找到我需要的“合并两个表”功能。

Say we have two tables both sorted on the time column:

t1:`time xasc ([]time:5?100;v:5?1000)
t2:`time xasc ([]time:5?100;v:5?1000)

Is there an efficient way to get the same result as `time xasc t1,t2 , using the fact that the two tables are already sorted? I looked at aj but I wasn't able to find the "combine two tables" functionality I need here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迟到的我 2025-01-18 16:09:29

kdb 中没有本机合并排序/二进制排序,因此最佳可用方法是 asc x,y。如果您沿着在 kdb 中复制合并/二进制排序的路径,那么您不太可能比本机 asc x,y 更快地获得它。您也可以尝试用 C 编写合并/二进制排序并导入共享库以在 kdb 中使用

There is no native merge-sort/binary-sort in kdb so the optimal available approach is asc x,y. If you go down the path of replicating a merge/binary sort in kdb then you're unlikely to get it faster than the native asc x,y. You could alternatively try to write a merge/binary sort in C and import a shared library to use in kdb

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文