你好,老洪,说来惭愧,书买了很久了,但一直没有仔细拜读,只是功利主义的找个别章节来读了,最近得闲,仔细研读。
然而,在第一章1.3.1中的例子好像不对,union的结果是左右结果集的去重并集,(123)union(245) =(12345),而你改过之后的语句取值不对。
思路是没错,例子怕是举错了吧。
P32,书中指出“在64位系统中,必须将SHMMAX(共享内存段的最大大小)设置为最小值1GB(1073741824字节)”。根据信息中心的修改内核参数LINUX的介绍,SHMMAX应该设置成<RAM大小,以字节计>。
在developworks中看到如下的说明“DB2 will try to acquire the entire database memory area using a single segment if possible. If that fails (i.e. due to shmmax), then we'll retry using multiple 1GB segments, which is why you did not see any benefit to increasing shmmax to 4GB (it's still too small). So, if you set shmmax to 9GB or larger, you should see only a single segment created. In DB2 9.5, we recommend setting shmmax to the amount of RAM on the machine to avoid the multi-segment issue.
I can't say what the performance benefits of fewer segments may be - it will likely be dependent on your workload. If you have a highly variable workload where connections (and so DB2 agents too) are constantly coming and going, it may have more of an effect, since when the DB2 agent is associated to the database, it will need to make 9 system calls to attach each of those segments, rather than a single system call (similarly when the agent needs to disassociate from the database). Even if you can't see any tangible performance benefits though, it shouldn't hurt to increase shmmax.”
https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=77777777-0000-0000-0000-000014068277
所以,我有了疑问,单段和多段哪种性能更好? 我们到底应该怎么来设置SHMMAX?