Summary: Page size is one of the most important storage decisions in GBase Database(GBase 8s). It is configured when a dbspace is created and cannot be changed afterward. This guide explains how to configure page size, choose the right value for your workload, understand its relationship with BUFFERPOOL, and avoid costly storage migrations.
1. Page Size Is a One-Time Storage Decision
Page size is one of the few database storage parameters that cannot be adjusted after a dbspace has been created.
In GBase Database(GBase 8s), the default page size is 2KB, with four supported options:
- 2KB
- 4KB
- 8KB
- 16KB
The maximum supported page size is 16KB, and each option is a multiple of 2KB.
You specify the page size during dbspace creation using the -k parameter of onspaces.
For example:
touch /data/gbase/datachk01
chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01
onspaces -c -d datadbs01 \
-p /data/gbase/datachk01 \
-o 0 -s 102400 -k 16
The final parameter, -k 16, specifies a page size of 16KB.
The SQL Administration API provides an alternative:
EXECUTE FUNCTION task(
'create dbspace',
'datadbs02',
'/data/gbase/datachk02',
'1024000',
'0',
'16'
);
Here, the final argument also specifies the page size in KB.
Both methods establish the page size when the dbspace is created. It cannot be modified afterward.
2. How to Choose the Right Page Size
There is no universally optimal page size. The decision should reflect the application's data structure and access patterns.
Two workload characteristics are particularly important.
Small pages: Short rows and random access
Smaller pages can reduce unnecessary data reads when workloads frequently access individual short rows.
For example, if an application frequently retrieves small records, reading a much larger page may bring more data into memory than the query actually needs.
Large pages: Wide rows and sequential scans
Larger pages can improve I/O efficiency for wide rows and workloads involving batch scans.
When rows are large, a small page may require multiple page reads to retrieve one row, increasing I/O operations.
A practical comparison:
| Workload characteristic | Consideration |
|---|---|
| Short rows | Smaller pages |
| Frequent random access | Smaller pages may help |
| Wide rows | Larger pages may help |
| Batch scans | Larger pages may reduce I/O operations |
| Mixed workloads | Benchmark with representative data |
These are starting points, not universal performance rules. Actual results depend on row width, access patterns, buffer pool configuration, and storage characteristics.
The important thing is to evaluate these factors before creating the dbspace.
3. Page Size Also Affects BUFFERPOOL
Page size is not only a storage configuration parameter. It is also closely related to memory configuration.
In GBase Database(GBase 8s), the BUFFERPOOL configuration in onconfig includes a size parameter that must match the page size of the corresponding dbspace.
The total buffer pool memory can be understood as:
[
\text{Memory} = \text{buffers} \times \text{page size}
]
For example, assuming the same number of buffers:
- 2KB pages consume 2KB per buffer.
- 4KB pages consume 4KB per buffer.
- 8KB pages consume 8KB per buffer.
- 16KB pages consume 16KB per buffer.
Doubling the page size while keeping the buffer count unchanged doubles the memory consumed by that buffer pool.
Conversely, if memory allocation remains fixed, doubling page size means the buffer pool can hold only half as many pages.
This affects cache capacity and potentially the buffer hit rate.
Therefore, page size selection and BUFFERPOOL planning should be reviewed together rather than treated as independent configuration tasks.
4. How to Verify Page Size After Creation
After creating a dbspace, use onstat -d to verify its actual page size.
onstat -d
Check the pgsize column in the Dbspaces section.
Then compare the value with the corresponding BUFFERPOOL size setting in onconfig.
For example, a 16KB dbspace should have a corresponding 16KB buffer pool configuration.
This verification should be included in the database deployment checklist.
It is much easier to identify a configuration mismatch during deployment than during an instance startup or performance incident.
5. What If You Already Chose the Wrong Page Size?
There is no direct command to change an existing dbspace from 2KB to 16KB.
If the original page size no longer fits the workload, the migration path generally involves:
- Create a new dbspace with the required page size.
- Prepare the necessary chunk files and permissions.
- Migrate tables and other database objects.
- Update storage assignments and defaults.
- Validate application behavior and performance.
- Complete the migration and retire the old space when safe.
This is not a simple configuration adjustment.
It involves additional storage capacity, data migration, application validation, maintenance windows, and rollback planning.
That is why page size belongs in the initial database design review, not in a troubleshooting discussion after the application starts experiencing I/O problems.
6. Put Page Size on the Database Build Checklist
A reliable GBase Database deployment should document page size alongside other storage decisions.
My recommended checklist includes:
- Business dbspace page size
- Temporary dbspace allocation
- Smart large object storage
- Chunk file paths and permissions
- BUFFERPOOL configuration
- Storage expansion strategy
- Post-creation verification
GBase Database(GBase 8s) provides page sizes from 2KB to 16KB, but the database cannot determine which one is best for your application.
That decision requires understanding the workload before the storage space exists.
The takeaway: Page size is not a runtime tuning parameter. It is a storage design decision with long-term consequences. One additional review before dbspace creation can save an entire data migration later.
Keywords: GBase Database, GBase Database 8s, database page size, dbspace management, onspaces, BUFFERPOOL, database performance tuning, database storage configuration
Top comments (0)