dbcalc”is a tool that helps a developer to experiment with different schemas. Itcannot and was never intended to answer the question "what is the optimalpage size for my schema?". Please understand that the optimal page size isderived from balancing the database object sizes and database performance. Forexample, a smaller page size conserves space for dynamic objects (strings,vectors and blobs) but increases object allocation time and causes larger indextrees that can make lookup operations slower.
Dbcalcis intended to help a developer experiment with different data distributionsamong the database classes, different key distributions between indexes andetc. This tool creates and populates a database with the given schema and thenprints database statistics that gives the developer an idea about the fullpicture of memory distribution in the database. Yes, it prints some page sizerecommendation but this is very rough. The only way to determine a good pagesize is to experiment and refine it.
Inyour case you are using persistent storage; that reduces the number of optionswrt the page size. The disk page size has to be power of two and should beequal to the block size of file system used to store the storage/log files.This usually leaves only two options: 4096 or 8192. The memory page size has tobe power of two if persistent storage is used and has to fit into the disk pagesize, so you have options of 128 or 256 bytes really. So in your case the onlyway to make the database smaller is to get rid of unused or rarely used indexes(eg. the lists?) and think about your use of dynamic fields. eXtremeDB uses atree-like allocator for dynamic objects which means that if the page size is128 bytes and a class has an int and a string and the string is 5 bytes longthen each instance of this class will take an entire 128 byte page. Very oftenchanging from dynamic to static fields can save significant space.

本文介绍了dbcalc工具如何帮助开发者实验不同的数据库模式,并提供了一些关于页面大小推荐的基本指导原则。通过调整数据分布、索引分布等参数,开发者可以了解内存在数据库中的分布情况,从而优化数据库性能。
584

被折叠的 条评论
为什么被折叠?



