我遇到这个代码,并不完全明白它的作用:
public uploadItem(value:FileItem):void {
let index = this.getIndexOfItem(value);
let item = this.queue[index];
let transport = this.options.isHTML5 ? '_xhrTransport' : '_iframeTransport';
item._prepareToUploading();
if (this.isUploading) {
return;
}
this.isUploading = true;
(this as any)[transport](item);
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释这个 (这个任何)声明是做什么的吗?
我有很多进口的外国表IMPORT FOREIGN SCHEMA
:
CREATE USER MAPPING FOR myuser
SERVER postgres
OPTIONS ( user 'myuser', password 'mypass');
IMPORT FOREIGN SCHEMA public from server postgres INTO public;
Run Code Online (Sandbox Code Playgroud)
我有很多查询加入了我的本地表和外部表。
Q1:如果我使用pg_prewarm
并把整个表放在内存中,不是每次都通过网络取这张表对我有帮助。
Q2:我担心如果外部表被缓存,外部 PostgreSQL 服务器上的数据更改是否会在我的本地服务器上可见。
示例:core_category
是一个外部表
SELECT pg_prewarm(
'core_category',
-- "pre warm" pages of the last 1000 pages for 'mytable'
first_block := (
SELECT pg_relation_size('core_category') / current_setting('block_size')::int4 - 1000
)
);
-- or
SELECT * FROM pg_prewarm('core_category', 'buffer');
Run Code Online (Sandbox Code Playgroud)