前几天做一个需求用到了sql in 子查询,
大概sql如下
SELECT * FROM table_a WHERE id IN (SELECT id FROM table_id_list)
执行时间150m,完全没法忍受
单独执行
SELECT id FROM table_id_list
秒查,只有七八行结果。
把查询结果写死在sql中
SELECT * FROM table_a WHERE id IN (1,2,3,4,5)
依然秒查
解决方案
再把ID列表select一次
SELECT * FROM table_a WHERE id IN (SELECT id from(SELECT id FROM table继续阅读 »
In 'Project'->'Compute'->'Overview' pannel of Horizon, a common user can see some OpenStack resources usage information in 'Limit Summary' table in pie chart. By default, that includes 'Instances', 'VCPUs', 'RAM', 'Floating IPs', 'Security Groups', 'Volumes' and 'Volume Storage'. Horizon will get usage of those resourc继续阅读 »
In R, function may not be as special as it is in other programming languages; it is regarded as one of the many types and can be passed as an argument to some other function. The way we deal with other objects such list and data.frame definitely applies to function. Here is a simple example in which we define two funct继续阅读 »
In a large cluster, some un-expected long running task hold back the job’s runtime sometimes. And those long running tasks are hard to locate in such a large cluster. Some ideas are shown here to help to locate those long running tasks. One of them will be implemented in the coming released of OGL.继续阅读 »
People love dealing with well-structured data. It costs much less efforts than working with disorganized raw texts.
In economic and financial research, we typically download data from open-access websites or authentication-required databases. These sources may provide data in multiple formats. For example, almost all 继续阅读 »
In recent years, non-relational data have attracted more and more attentions. Roughly speaking, all datasets that are hard to put into a rectangular table with rows and columns are non-relational datasets.继续阅读 »