btree: Introduce default page size param, set to 4096.

This is kind of workaround for issues found with handling overflow pages.
Setting default page size will make a less chance for user to hit them.
This commit is contained in:
Paul Sokolovsky 2016-08-09 02:08:14 +03:00
parent 2328ab24e8
commit 78a4787948
2 changed files with 2 additions and 4 deletions

View file

@ -258,10 +258,7 @@ __bt_open(file, vtable, openinfo, dflags)
* Don't overflow the page offset type. * Don't overflow the page offset type.
*/ */
if (b.psize == 0) { if (b.psize == 0) {
if (b.psize < MINPSIZE) b.psize = DEFPSIZE;
b.psize = MINPSIZE;
if (b.psize > MAX_PAGE_OFFSET + 1)
b.psize = MAX_PAGE_OFFSET + 1;
} }
/* Set flag if duplicates permitted. */ /* Set flag if duplicates permitted. */

View file

@ -46,6 +46,7 @@
#define DEFMINKEYPAGE (2) /* Minimum keys per page */ #define DEFMINKEYPAGE (2) /* Minimum keys per page */
#define MINCACHE (5) /* Minimum cached pages */ #define MINCACHE (5) /* Minimum cached pages */
#define MINPSIZE (512) /* Minimum page size */ #define MINPSIZE (512) /* Minimum page size */
#define DEFPSIZE (4096) /* Default page size */
/* /*
* Page 0 of a btree file contains a copy of the meta-data. This page is also * Page 0 of a btree file contains a copy of the meta-data. This page is also