Re: Caching by Postgres

From: Alan Stange <stange(at)rentec(dot)com>
To: mark(at)mark(dot)mielke(dot)cc
Cc: Donald Courtney <Donald(dot)Courtney(at)Sun(dot)COM>, William Yu <wyu(at)talisys(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Caching by Postgres
Date: 2005-08-24 18:47:09
Message-ID: 430CC0AD.5040400@rentec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

mark(at)mark(dot)mielke(dot)cc wrote:
> So then we move on to what 64-bit is really useful for. Obviously,
> there is the arithmetic. If you were previously doing 64-bit
> arithmetic through software, you will notice an immediate speed
> improvement when doing it through hardware instead. If you have
> a program that is scanning memory in any way, it may benefit from
> 64-bit instructions (for example - copying data 64-bit words at
> a time instead of 32-bit words at a time). PostgreSQL might benefit
> slightly from either of these, slightly balancing the performance
> degradation of using more memory to store the pointers, and more
> memory bandwidth the access the pointers.
>
At least on Sparc processors, v8 and newer, any double precision math
(including longs) is performed with a single instruction, just like for
a 32 bit datum. Loads and stores of 8 byte datums are also handled via
a single instruction. The urban myth that 64bit math is
different/better on a 64 bit processor is just that; yes, some lower
end processors would emulate/trap those instructions but that an
implementation detail, not architecture. I believe that this is all
true for other RISC processors as well.

The 64bit API on UltraSparcs does bring along some extra FP registers IIRC.

> If, however, you happen to have a very large amount of physical memory
> - more memory than is supported by a 32-bit system, but is supported
> by your 64-bit system, then the operating system should be able to use
> this additional physical memory to cache file system data pages, which
> will benefit PostgreSQL if used with tables that are larger than the
> memory supported by your 32-bit system, and which have queries which
> require more pages than the memory supported by your 32-bit system to
> be frequently accessed. If you have a huge database, with many clients
> accessing the data, this would be a definate yes. With anything less,
> it is a maybe, or a probably not.
>
Solaris, at least, provided support for far more than 4GB of physical
memory on 32 bit kernels. A newer 64 bit kernel might be more
efficient, but that's just because the time was taken to support large
page sizes and more efficient data structures. It's nothing intrinsic
to a 32 vs 64 bit kernel.

-- Alan

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message William Yu 2005-08-24 18:54:42 Re: Caching by Postgres
Previous Message mark 2005-08-24 17:30:56 Re: Caching by Postgres