我正在将 MATLAB 连接到 Wharton Research Data Services COMPUSTAT 数据库并运行一个简单的查询
WRDS_Connect
setdbprefs('FetchInBatches','yes')
query = exec(WRDS, ['select gvkey from COMP.FUNDA where fyear = 2000 order by gvkey asc']);
result = fetch(query);
result.data
WRDS_Connect 只是使用 JDBC 驱动程序建立与 WRDS 服务器的连接,并且
WRDS = database(instance, username, password, serverAddress);
查询不是太大,给了我 27000 行数据。不过时间太长了。分析显示,这 27000 行大约需要 5 分钟。我实际上想进行更广泛的查询,但不应该花这么长时间。
我能做些什么来加快速度吗?我附上了分析的截图。
谢谢你的帮助!