Postgres报告在执行相当大的聚合查询时磁盘空间不足:
Caused by: org.postgresql.util.PsqlException: ERROR: could not write block 31840050 of temporary file: No space left on device at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304) at org.hibernate.engine.query.NativesqlQueryPlan.performExecuteUpdate(NativesqlQueryPlan.java:189) ... 8 more
但是磁盘有很大的空间:
Filesystem Size Used Avail Use% Mounted on /dev/sda1 386G 123G 243G 34% / udev 5.9G 172K 5.9G 1% /dev none 5.9G 0 5.9G 0% /dev/shm none 5.9G 628K 5.9G 1% /var/run none 5.9G 0 5.9G 0% /var/lock none 5.9G 0 5.9G 0% /lib/init/rw
该查询正在执行以下操作:
INSERT INTO summary_table SELECT t.a,t.b,SUM(t.c) AS c,COUNT(t.*) AS count,t.d,t.e,DATE_TRUNC('month',t.start) AS month,tt.type AS type,FALSE,tt.duration FROM detail_table_1 t,detail_table_2 tt WHERE t.trid=tt.id AND tt.type='a' AND DATE_PART('hour',t.start AT TIME ZONE 'Australia/Sydney' AT TIME ZONE 'America/New_York')>=23 OR DATE_PART('hour',t.start AT TIME ZONE 'Australia/Sydney' AT TIME ZONE 'America/New_York')<13 GROUP BY month,type,t.a,tt.duration
有小费吗?