English 中文(简体)
邮政总局64台借机的4台和8台的运行差额
原标题:Performance difference between int4 and int8 in PostgreSQL on 64 bit server

假设邮政管理处正在使用64台借机服务器,在t4(32轨)和t8(64轨)一栏之间业绩差异如何? 该手册指出,t4比t8更有效率,但如果基础服务器为64比值,是否存在着实际业绩差异(从(1)小盘、(2)记忆和(3)储存而言)?

最佳回答

in terms of (1) cpu, (2) memory and (3) storage

::

  1. 64个比值是32个比值的两倍。

  2. 64个比值是32个比值的两倍。

  3. 64个比值是32个比值的两倍。

我回顾一下,有几条基准的堆积器read。 编制一个表格,填补100万分。 然后发现、增加、群体、加入等。 我不记得这些具体内容,但使用无动于衷8比无动于4。


test=# create table int4_test (id int primary key);
CREATE TABLE
test=# create table int8_test (id bigint primary key);
CREATE TABLE
test=# insert into int4_test select i from generate_series(1,1000000) i;
INSERT 0 1000000
test=# insert into int8_test select i from generate_series(1,1000000) i;
INSERT 0 1000000
test=# vacuum analyze;
VACUUM
test=# 	iming on
Timing is on.
test=# select sum(i.id) from int4_test i natural join int4_test j where i.id % 19 = 0;
     sum     
-------------
 26315710524
(1 row)

Time: 1364.925 ms
test=# select sum(i.id) from int4_test i natural join int4_test j where i.id % 19 = 0;
     sum     
-------------
 26315710524
(1 row)

Time: 1286.810 ms
test=# select sum(i.id) from int8_test i natural join int8_test j where i.id % 19 = 0;
     sum     
-------------
 26315710524
(1 row)

Time: 1610.638 ms
test=# select sum(i.id) from int8_test i natural join int8_test j where i.id % 19 = 0;
     sum     
-------------
 26315710524
(1 row)

Time: 1554.066 ms

test=# select count(*) from int4_test i natural join int4_test j where i.id % 19 = 0;
 count 
-------
 52631
(1 row)

Time: 1244.654 ms
test=# select count(*) from int4_test i natural join int4_test j where i.id % 19 = 0;
 count 
-------
 52631
(1 row)

Time: 1247.114 ms
test=# select count(*) from int8_test i natural join int8_test j where i.id % 19 = 0;
 count 
-------
 52631
(1 row)

Time: 1541.751 ms
test=# select count(*) from int8_test i natural join int8_test j where i.id % 19 = 0;
 count 
-------
 52631
(1 row)

Time: 1519.986 ms
问题回答

在储存和记忆方面,答案是显而易见的: INT8与INT4一样大两倍,因此它两次使用储存和两次记忆。

在计算性能方面,我怀疑计算结果在64台轨道机器上根本不会改变,在某些情况下,INT4在32台轨道机器上可能更有效率。 尽管除非你在这些国际会计科目上做复杂的数学(而不仅仅是在序列上使用),但计算差异可能为零或几乎为零。

当你开始与你的信使做复杂的事时,这实际上不是数据库的绩效问题。





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签