小编pst*_*ton的帖子

我如何调整 postgres 以避免这个错误?

我收到错误

错误:无法写入临时文件的块 3478284:设备上没有剩余空间

运行以下查询时:

INSERT INTO summary SELECT t1.a, t1.b, SUM(t1.p) AS p, COUNT(t1.*) AS c,
    t1.d, t1.r, DATE_TRUNC('month', t1.start) AS month, t2.t AS t, t2.h, t2.x
FROM raw1 t1, raw2 t2
WHERE t1.t2_id=t2.id AND (t2.t<>'a' OR t2.y) GROUP BY month, t, a, b, d, r, h, x
Run Code Online (Sandbox Code Playgroud)

表 t1 非常大,表 t2 非常大

Caused by: org.postgresql.util.PSQLException: ERROR: could not write block 3478284 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) …
Run Code Online (Sandbox Code Playgroud)

postgresql

7
推荐指数
1
解决办法
2万
查看次数

postgresql 设备上没有剩余空间

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
Run Code Online (Sandbox Code Playgroud)

但是磁盘有相当多的空间:

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 …
Run Code Online (Sandbox Code Playgroud)

postgresql

5
推荐指数
2
解决办法
1万
查看次数

postgres 的最佳 RAID 配置

我正在购买带有 8 个 SAS 磁盘的服务器来执行数据库密集型程序。目前主要的瓶颈是 postgres 中的大型索引扫描。

我目前正在决定是 8x300Gb 10k 磁盘还是 8x140Gb 15k 磁盘,因为拥有 200Gb+ 逻辑空间会更方便。

RAID 控制器的规格表指出:“集成硬件 RAID-0、-1、-1E、可选 RAID-5、-6、-10、-50、-60”

什么是最好的 RAID 配置,以及最合适的磁盘选择是什么?

我是配置 RAID 和 postgres 的新手,并感谢您的建议。

postgresql raid hardware-raid

2
推荐指数
2
解决办法
9788
查看次数

哪个英特尔 CPU 更快?

我正在与一家试图向我出售新服务器的硬件公司的代表交谈,他坚称 E5504 CPU(具有 4mb 缓存的四核 2Ghz)将比我们现有的 Q6600 CPU(Core2 四核 2.4Ghz)快带有 8MB 缓存。

http://ark.intel.com/Compare.aspx?ids=29765,40711 ,

我错过了什么吗?

该系统将用于运行 CPU 密集型进程,该进程以尽可能高的速率执行许多简单的计算,并将结果存储在数据库中。然后该数据库用于许多索引扫描和复杂查询。

cpu-architecture

1
推荐指数
1
解决办法
423
查看次数

如何加速数据库 - 仅限硬件

简单的问题 - 仅使用硬件来提高数据库性能的最佳方法是什么?

在这种情况下,一次有 1-4 个进程会定期查询一些非常非常大的表。

我们正在执行数以千计的查询,其中许多需要 +10 秒才能返回,而且所有查询都只返回少量数据。这向我表明 HDD 寻道时间是瓶颈。

作为此过程的一部分,我们还需要根据原始数据表创建汇总表。其中一个查询可能需要数小时才能运行。

请假设所有软件/数据库优化都已经完成。

假设这是因为我们花了一些时间进行代码/数据库优化,并准备在硬件上花费一些预算。我知道更多的软件/数据库优化是可能的,但这不是当前的重点。

我们目前没有用完 ram,但可能会分配更多给 DB。

当前平台是windows,这可能会根据硬件解决方案而改变。

数据库是 postres 8.4。

谢谢。

postgresql hardware windows database

0
推荐指数
1
解决办法
1166
查看次数

64 位 linux 或 64 位 Windows Server 2008 上的 postgres?

Postgres 没有用于 Windows 服务器的 64 位二进制文​​件

引用 “因为通常没有理由在 Windows 上使用 shared_buffers > 256 - 512MB 运行,所以没有很大的动力去投入 64 位端口所需的努力”

  1. 为什么通常没有理由在 Windows 上运行大量内存?
  2. 64 位 linux 安装会更有效率吗?如果是,是哪个?

这台服务器有 8Gb 内存,这个数字可能会增加到 12Gb。我们打算将几乎所有的内存分配给 postgres。对于我正在做的事情,我可以很高兴地在没有 UI 的情况下进行。

postgresql linux windows-server-2008 64-bit

0
推荐指数
1
解决办法
4163
查看次数