我们目前正在使用Python在完全在线上运行许多手工构建和优化的OData查询。这涉及数千个部门。但是,为了便于维护,我想将它们迁移到Invantive SQL。
但是,一些优化,如OData查询中的显式orderby,并不是由Invantive SQL在线转发的;它们只是检索所有数据或顶部x,然后执行命令。
特别是对于最大值的确定,可能要慢得多。
小桌子上的简单样品:
https://start.exactonline.nl/api/v1/<<division>>/financial/Journals?$select=BankAccountIBAN,BankAccountDescription&$orderby=BankAccountIBAN desc&$top=5是否有其他方法来优化Invantive SQL执行的实际OData查询?
发布于 2018-04-26 09:12:28
您可以使用数据复制器,也可以通过本机平台请求发送手工OData查询,如:
insert into NativePlatformScalarRequests
( url
, orig_system_group
)
select replace('https://start.exactonline.nl/api/v1/{division}/financial/Journals?$select=BankAccountIBAN,BankAccountDescription&$orderby=BankAccountIBAN desc&$top=5', '{division}', code)
, 'MYSTUFF-' || code
from systempartitions@datadictionary
limit 100 /* First 100 divisions. */
create or replace table exact_online_download_journal_top5@inmemorystorage
as
select jte.*
from ( select npt.result
from NativePlatformScalarRequests npt
where npt.orig_system_group like 'MYSTUFF-%'
and npt.result is not null
) npt
join jsontable
( null
passing npt.result
columns BankAccountDescription varchar2 path 'd[0].BankAccountDescription'
, BankAccountIBAN varchar2 path 'd[0].BankAccountIBAN'
) jte从现在开始,您可以使用内存中的表,如:
select * from exact_online_download_journal_top5@inmemorystorage当然,您也可以“插入sqlserver”。
https://stackoverflow.com/questions/50039100
复制相似问题