Java JIT是否在同一台机器上的每次运行中使用相同的优化编译字节码?
是否考虑了特定时刻的CPU使用率等动态因素,或者无论临时因素如何,它都会每次进行相同的优化?
对于~700个ID的列表,查询性能比传递返回700个ID的子查询慢20多倍.应该是相反的.
例如(第一次查询不到400毫秒,后来的9600毫秒)
select date_trunc('month', day) as month, sum(total)
from table_x
where y_id in (select id from table_y where prop = 'xyz')
and day between '2015-11-05' and '2016-11-04'
group by month
Run Code Online (Sandbox Code Playgroud)
我的机器比直接传递数组快20倍:
select date_trunc('month', day) as month, sum(total)
from table_x
where y_id in (1625, 1871, ..., 1640, 1643, 13291, 1458, 13304, 1407, 1765)
and day between '2015-11-05' and '2016-11-04'
group by month
Run Code Online (Sandbox Code Playgroud)
知道可能是什么问题或如何优化和获得相同的性能?
postgresql in-operator postgresql-performance postgresql-9.5