postgresql设备上没有剩余空间

前端之家收集整理的这篇文章主要介绍了postgresql设备上没有剩余空间前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Postgres报告在执行相当大的聚合查询时磁盘空间不足:
  1. Caused by: org.postgresql.util.PsqlException: ERROR: could not write block 31840050 of temporary file: No space left on device
  2. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
  3. at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
  4. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
  5. at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
  6. at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
  7. at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:304)
  8. at org.hibernate.engine.query.NativesqlQueryPlan.performExecuteUpdate(NativesqlQueryPlan.java:189)
  9. ... 8 more

但是磁盘有很大的空间:

  1. Filesystem Size Used Avail Use% Mounted on
  2. /dev/sda1 386G 123G 243G 34% /
  3. udev 5.9G 172K 5.9G 1% /dev
  4. none 5.9G 0 5.9G 0% /dev/shm
  5. none 5.9G 628K 5.9G 1% /var/run
  6. none 5.9G 0 5.9G 0% /var/lock
  7. none 5.9G 0 5.9G 0% /lib/init/rw

查询正在执行以下操作:

  1. 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
  2. FROM detail_table_1 t,detail_table_2 tt
  3. WHERE t.trid=tt.id AND tt.type='a'
  4. AND DATE_PART('hour',t.start AT TIME ZONE 'Australia/Sydney' AT TIME ZONE 'America/New_York')>=23
  5. OR DATE_PART('hour',t.start AT TIME ZONE 'Australia/Sydney' AT TIME ZONE 'America/New_York')<13
  6. GROUP BY month,type,t.a,tt.duration

有小费吗?

还要检查“df -i”的输出,它会报告正在使用的inode数量.耗尽inode也会产生“无可用空间”类型的错误,但你仍然有足够的可用空间.

猜你在找的Postgre SQL相关文章