KDB 离散 Select 多项
KDB Discrete Select Multiple items
在 FIX 架构中,我有一个名为 channelID 的列。 channelID 列的值可以是 SERVERNAME-Inbound、SERVERNAME-Client、SERVERNAME-Venue。
目前正在尝试通过 select 前 10,000 行来实现高效 select:
'time xdesc select [2500] from table_name where (channelID like "*Inbound)
这很好用并检索了 channelID 具有 Inbound 的前 2,500 行。
我想有效地运行查询我在select前 2500 个渠道 ID 具有“Inbound”、“Client”或“Venue”的实例。
我唯一的想法是在 table 上进行自连接。结果集应为 7,500 行,其中每个 channelID(“Inbound”、“Client”或“Venue”)有 2,500 行。
有什么想法吗?
我想您可能正在寻找的是这样的东西:
select from table_name where any channelId like/: ("*Inbound";"*Client";"*Venue"), 2499 >= (iasc;i) fby channelID
where 子句的第一部分将 table 过滤到只有 channelID 在您要查找的 ID 中的那些行。
第二部分将采用 subtable 并使用 fby
到 return,其中每个剩余 channelID 集合中的索引小于或等于 2499(由于索引从 0 开始) .
在 FIX 架构中,我有一个名为 channelID 的列。 channelID 列的值可以是 SERVERNAME-Inbound、SERVERNAME-Client、SERVERNAME-Venue。
目前正在尝试通过 select 前 10,000 行来实现高效 select:
'time xdesc select [2500] from table_name where (channelID like "*Inbound)
这很好用并检索了 channelID 具有 Inbound 的前 2,500 行。
我想有效地运行查询我在select前 2500 个渠道 ID 具有“Inbound”、“Client”或“Venue”的实例。
我唯一的想法是在 table 上进行自连接。结果集应为 7,500 行,其中每个 channelID(“Inbound”、“Client”或“Venue”)有 2,500 行。
有什么想法吗?
我想您可能正在寻找的是这样的东西:
select from table_name where any channelId like/: ("*Inbound";"*Client";"*Venue"), 2499 >= (iasc;i) fby channelID
where 子句的第一部分将 table 过滤到只有 channelID 在您要查找的 ID 中的那些行。
第二部分将采用 subtable 并使用 fby
到 return,其中每个剩余 channelID 集合中的索引小于或等于 2499(由于索引从 0 开始) .