Jay Taylor's notes

back to listing index

mysql - Should I install 32-bit database or 64-bit database? - Server Fault

[web search]
Original source (serverfault.com)
Tags: database postgres postgresql 32-bit 64-bit dbms serverfault.com
Clipped on: 2012-08-20

(I've read a lot about 64-bit versus 32-bit OS/Apps, but this question is specifically in regards to databases.)

I'm trying to understand the pros and cons of 32-bit versus 64-bit databases, and namely, under what conditions that it starts to make sense to use 64-bit installations.

The database systems that I am interested in are: SQL Server 2008, MySQL, and PostgreSQL 9.0.

I have read that pre-9.0 versions of PostgreSQL only comes in 32-bit for Windows, and this article about running 32-bit PostgreSQL on 64-bit Windows clears up some of my confusion, but I'm looking for more info.

When would I benefit from using 64-bit databases (i.e. database size/disk space, available system memory, types of data sernarios that are known to benefit from it, which database engine being used, etc.)?

asked Jul 13 '10 at 20:49
Image (Asset 1/16) alt=19118

57% accept rate
add comment

4 Answers

up vote 17 down vote accepted

under what conditions that it starts to make sense to use 64-bit installations.


Under all except being idiotic. Sorry - what good would be installing a 32 bit database on a 64 bit server? And - imagine - SERVER 2008R2 is ONLY available in 64 bit.

There is - today - no scenario where it makes sense to install a 32 bit SQL Server version if one has a chance.

Databases are specific in this - as they want to use a lot of memory as cache if necessary. A lot more than the meager 2gb / 3gb a 32 bit process can give them. PAE is not the same. Even ignoring limits, PAE memory is not equal to real memory for a SQL Server´(it is only used for ONE thing - caching db pages).

32 bit OS - is on the same level. it makes no sense on modern hardware at all to install a 32 bit OS.

answered Jul 13 '10 at 21:12
Image (Asset 2/16) alt=24.1k21034
3 upvote
+1 Amen Brother!! – DaniSQL Jul 13 '10 at 21:41
4 upvote
Well as far as 32-bit OS and Apps, there are some minor advantages, such as smaller memory footprint. – JohnB Jul 13 '10 at 22:03
@TomTom: SQL Server 2008 R2 is available in 32-bit (scroll down slightly) msdn.microsoft.com/en-us/library/ms143506.aspx – JohnB Jul 14 '10 at 3:02
1 upvote
Yes, smaller footprint. SADLY especially for databases that is irrelevant. A database is not word. It deals with - under most installs - LOTS of data, so accessing LOTS of RAM makes sense. – TomTom Jul 14 '10 at 4:51
... Lots of ram being more than 4GB in a process? You know how many SQL servers don't provide that for the whole multi-processed server? I'm not arguing that it is a bad idea to have a 64bit OS, and SQL server, but I will say there are plenty of configurations where it doesn't matter /at all/. – Evan Carroll Jul 14 '10 at 6:09
add / show 1 more comment

PostgreSQL benefits from having a 64-bit build in two main ways. First, data types that can fit into 64-bits (larger integers and timestamp types mainly) can be more efficiently passed around directly in registers rather than using pointers. Second, it's possible to allocate more memory for the database's dedicated buffer cache. The point of diminishing returns on that tunable (shared_buffers) is usually around 8GB, but it will be limited to <2GB on a 32-bit system.

However, if you are on Windows, PostgreSQL doesn't handle shared memory as efficiently as on UNIX-ish platforms. The point of diminishing return generally ends up being <=512MB of dedicated memory for the database whether you have a 32-bit or 64-bit build of PostgreSQL. You'll do better to leave the rest for the operating system cache rather than dedicate it to the database. Accordingly, there really isn't that much of a performance gain going from 32 to 64 bits with PostgreSQL on Windows; the main tunable that would normally benefit from having more RAM available doesn't actually utilize it very well.

answered Jul 16 '10 at 2:31
Image (Asset 3/16) alt=69935
1 upvote
Note that some people have reported seeing a benefit from 64-bit Windows PostgreSQL by setting very large values for work_mem, which lets the server sort larger amounts of data in memory. – Greg Smith Mar 12 '11 at 16:59
add comment

I run MySQL on 64-bit architecture because I want them to most efficiently utilize more than 4GB of memory per thread. Generally speaking, this should apply to all databases.

One of the primary differences between the architectures is increased addressing allows greater memory handling. While Intel's Physical Address Extension allows addressing of more than 4GB, it is still limited to 4GB per thread. PAE allows up to a 64GB maximum.

Wikipedia has a comparison of 64-bit versus 32-bit, which includes more low level details.

answered Jul 13 '10 at 21:09
Image (Asset 4/16) alt=15.2k12039
1 upvote
It is per process, not per thread. Threads share the same memory space. – Evan Carroll Jul 14 '10 at 6:13
add comment

For so many things, 32 bit is a win (as long as you can live with the address space), but DB are one thing where even small databases can get a real boost running in 64 bit. Granted, I don't know a thing about MS SQL server, but I have seen benchmarks (for example, on a Sun 5 (older 64 bit Sun desktop), 32 bit was generally a little faster, except for mysql, which was 30% faster in 64 bit.

answered Jul 14 '10 at 1:41
Image (Asset 5/16) alt=1,026314
2 upvote
"For so many things, 32 bit is a win" - Examples?? – Chris S Jul 14 '10 at 2:40
1 upvote
The only case I can imagine where a 32 bit database would be faster than 64 bit is if the code hasn't been compiled with appropriate optimisations. As far as business software goes, databases are probably the thing than can best take advantage of what 64 bits offers. – John Gardeniers Jul 14 '10 at 3:20
1 upvote
Well, large numbers of benchmarks in the RISC 32>64 transition era, and at least the early x86 showed little if any benefit to 64 bit, unless you need the address space, and db do. I didn't want to believe it either, and I bet for x86 today, 64 bit is always faster (just because you escape that i32 instruction set). Anandtech.com has benchmarks until your eyeballs bleed. Remember: SHOW ME THE DATA. – Ronald Pottol Jul 14 '10 at 7:12
1 upvote
All else being equal, the main disadvantage that i can think of for 64-bit is with larger pointers (64-bits), which will take up more cache memory space than an equivalent 32-bit dynamic data structure (i.e. linked lists, trees...). This reduces the amount of cache memory available. This symptom also persists in main memory. My 64-bit Debian server with only 64Mb of RAM uses more swap and runs less apps than a similarly setup 32-bit server. – sybreon Jul 14 '10 at 7:59
1 upvote
@sybreon: I think I have an old 128mb laying around if you need it! – JohnB Jul 14 '10 at 14:42
add / show 3 more comments

Your Answer

community wiki

Not the answer you're looking for? Browse other questions tagged or ask your own question.


 × 4245
 × 1580
 × 958
 × 761
 × 84


2 years ago


3,731 times


2 years ago

97 People Chatting