-1

I had a talk with a professional who works in a hosting company and he told me that MS SQL Server does take more memory than MySQL in performing its queries. Is that true? And why do you think is the reason behind this? What makes SQL Server require more RAM?

Rob Moir
  • 31,884
  • 6
  • 58
  • 89
Goma
  • 217
  • 1
  • 3
  • 10

2 Answers2

5

It is likely because the guy (a) did not really know what he talks about and (b) MS does not target mini databases.

For a: SQL Server uses - unless told otherwise - as much RAM as it can to cache database pages in memory. This means in any environment which is active, and has non-trivial databases larger than the memory, the memory WILL fill up to 100%. Point. This is by design to speed things up, and SQL Server rightly assumes it runs alone (serious databases do) and knows better than the file system cache. Often people with poor knowledge of SQL Server overlook that. If you want SQL Server to use little RAM, the admin HAS TO SAY SO (it is a setting limiting the RAM used).

For b: SQL Server is aimed at high-end scalability, and MS Often does not consider the lower end edge case something to optimize for. Whether it uses 10 or 20mb RAM makes no practical difference, but scalability once you hit 1000gb is more important.

At the end, without knowing the details, it is unknown whether the guy ran into a low scalability issue or was simply incompetent.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
TomTom
  • 51,649
  • 7
  • 54
  • 136
  • I would vote for the guy at the hosting company being incompetent. – mrdenny Mar 24 '11 at 08:05
  • Have to agree with this... it may be that MySQL is better at fitting into *lower end* requirements but the majority of admins seem to just install whatever version of SQL they know and don't bother (or even realise it is possible) to tune pretty much all of them to fit into different circumstances) – Rob Moir Mar 24 '11 at 08:06
1

It's been a while since I've done a MySQL install (Sun buying them diminished my love of them and then the subsequent buy by Oracle has just about killed it), but if I recall correctly, MySQL's installation prompts for settings that effectively limit MySQL's use of memory, etc., out of the box. SQL Server Standard and Enterprise editions, on the other hand, set up SQL Server to maximize resources on the server. This is different than SQL Server Express, which installs in a way that limits the resources it needs as much as possible.

SQL Server Express can be configured to use more resources (to a maximum point, since it is Express) and Standard and Enterprise editions can be configured to limit access to memory, processors, etc. They are fairly easy to configure using SQL Server Management Studio, but a lot of folks don't touch these settings. So out of the box MS SQL Server will take up more resources because it assumes you're going to want to maximize its use of resources for the best possible performance.

So with all this said, if your hosting guy just ran the install and went no further, MySQL will have a smaller footprint. But that doesn't mean MySQL can't be configured to use more nor does it mean SQL Server can't be configured to use less.

K. Brian Kelley
  • 9,034
  • 32
  • 33
  • In addition, it does not mean it makes sense. If you ahve a dedicated database box, then not using the memory is just dead stupid and wasted money. So, MySql installes should be adjusted then, while SqlServer is fine on larder dedicated servers. – TomTom Mar 24 '11 at 09:12