如何在 kdb 中的分区表上应用 asof join
how to apply asof join on partitioned tables in kdb
我需要 运行 asof 加入分区的交易和报价表的几年数据。
当我通读 - https://code.kx.com/v2/ref/aj/
以上 url 指出 -
"If further where constraints are used, the columns will be copied instead of mapped into memory, slowing down the join."
如何在不影响性能或内存的情况下使用 asof join over partitioned database with date and other constraints。
Eg: aj[`sym`time;select from trade where date>2019.01.01, app=`abc; select from quote where date>2019.01.01]
您应该为 each/peach
日期做 date=
和 运行,而不是做 date>
,即
raze{aj[`sym`time;select from trade where date=x, app=`abc;select from quote where date=x]}peach 2019.01.01 2019.01.02 2019.01.03
通常可以接受额外的贸易过滤器,但可能前提是该列 app
具有 parted 属性。您不能对报价或性能坦克设置任何过滤器。
请注意,使用这种方法您无法将前一天的现行数据连接到第二天,但在大多数情况下您 want/need 无论如何都不会这样做
我需要 运行 asof 加入分区的交易和报价表的几年数据。
当我通读 - https://code.kx.com/v2/ref/aj/
以上 url 指出 -
"If further where constraints are used, the columns will be copied instead of mapped into memory, slowing down the join."
如何在不影响性能或内存的情况下使用 asof join over partitioned database with date and other constraints。
Eg: aj[`sym`time;select from trade where date>2019.01.01, app=`abc; select from quote where date>2019.01.01]
您应该为 each/peach
日期做 date=
和 运行,而不是做 date>
,即
raze{aj[`sym`time;select from trade where date=x, app=`abc;select from quote where date=x]}peach 2019.01.01 2019.01.02 2019.01.03
通常可以接受额外的贸易过滤器,但可能前提是该列 app
具有 parted 属性。您不能对报价或性能坦克设置任何过滤器。
请注意,使用这种方法您无法将前一天的现行数据连接到第二天,但在大多数情况下您 want/need 无论如何都不会这样做