[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: allow DEFAULT_DB_PAGE_SIZE to be set (ITS#483)



Randy,

On Mon, 20 Mar 2000, Randy Kunkee wrote:

> But:
> 
> ./libraries/libldbm/ldbm.c:     dbinfo.db_pagesize  = DEFAULT_DB_PAGE_SIZE;
> 
> docs/api_c/DbInfo/info.html#db_pagesize:
> 
> size_t db_pagesize;
>      The size of the pages used to hold items in the database, in bytes.
>      The minimum page size is 512 bytes and the maximum page size is 64K bytes.
>      If db_pagesize is 0, a page size is selected based on the underlying
>      filesystem I/O block size. The selected size has a lower limit of 512
>      bytes and an upper limit of 16K bytes. 

That's IF you set it to zero.  Looking at the code for db-2.7.7/db/db.c,
line 276:

                /*
                 * Use the optimum I/O size as the pagesize if a pagesize not
                 * specified.  Some filesystems have 64K as their optimum I/O
                 * size, but as that results in impossibly large default cache
                 * sizes, we limit the default pagesize to 16K.
                 */
                if (dbp->pgsize == 0) {
                        if ((ret = __os_ioieal(real_name,
                            fd, NULL, NULL, &iopsize)) != 0) {
                                __db_err(dbenv,
                                    "%s: %sal_real_name, strerror(ret));
                                goto err;
                        }
                        if (iopsize < 512)
                                iopsize = 512;
                        if (iopsize > 16 * 1024)
                                iopsize = 16 * 1024;

		[ chop ]

Don
---
Don Badrak <dbadrak@census.gov>              301.457.8263 work
Telecommunications Office                    301.457.4438 fax
U.S. Bureau of the Census
Suitland MD, USA